From 9a6d8e2c0a9f5285a2f2d0e50bd4a2ab449aade7 Mon Sep 17 00:00:00 2001 From: NeuralFlux <40491005+NeuralFlux@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:20:19 -0400 Subject: [PATCH] chore: add OTel and Jaeger start scripts --- .vscode/launch.json | 28 +++++++++++++++++++++++++++- package.json | 4 +++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index f2a2c081..e691b443 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -185,6 +185,32 @@ ], "stopOnEntry": true, "console": "integratedTerminal" - } + }, + { + "name": "Build w/ Cache and Jaeger", + "type": "pwa-node", + "preLaunchTask": "start redis", + "runtimeArgs": [ + "run", + "debug-otel", + ], + "cwd": "${workspaceFolder}", + "runtimeExecutable": "pnpm", + "restart": false, + "env": { + "REDIS_HOST": "localhost", + "REDIS_PORT": "6379", + "DEBUG": "biomedical-id-resolver,bte*", + "SMARTAPI_SYNC": "false", + "RESULT_CACHING": "true", + "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4318", + }, + "request": "launch", + "skipFiles": [ + "/**" + ], + "stopOnEntry": true, + "console": "integratedTerminal" + }, ] } diff --git a/package.json b/package.json index 7c2dbd1e..694c1e60 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,9 @@ "start": "./scripts/start_server.sh", "stop": "./scripts/stop_server.sh", "watch": "nodemon -e js,mjs,json,ts --watch './packages/**/src/*' './packages/**/data/*' --exec 'pnpm run build && node .'", - "debug": "DEBUG=biomedical-id-resolver,bte* pnpm run watch" + "watch-otel": "nodemon -e js,mjs,json,ts --watch './packages/**/src/*' './packages/**/data/*' --exec 'pnpm run build && node --require ./packages/bte-server/built/controllers/opentelemetry.js .'", + "debug": "DEBUG=biomedical-id-resolver,bte* pnpm run watch", + "debug-otel": "DEBUG=biomedical-id-resolver,bte* pnpm run watch-otel" }, "engines": { "node": ">=18.0.0",