Skip to content

Commit

Permalink
Fix tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Sep 25, 2023
1 parent f19aa27 commit 78f66a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@myrotvorets/oav-installer": "^4.0.1",
"@myrotvorets/opentelemetry-configurator": "^4.0.1",
"@opentelemetry/instrumentation-express": "^0.33.0",
"@opentelemetry/instrumentation-http": "^0.43.0",
"envalid": "^8.0.0",
"express": "^4.17.1",
"express-openapi-validator": "^5.0.3",
Expand Down
3 changes: 3 additions & 0 deletions src/lib/tracing.mts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/* c8 ignore start */
import { EventEmitter } from 'node:events';
import { OpenTelemetryConfigurator } from '@myrotvorets/opentelemetry-configurator';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';

if (+(process.env.ENABLE_TRACING || 0)) {
const configurator = new OpenTelemetryConfigurator({
serviceName: 'psb-api-videntigraf',
instrumentations: [new HttpInstrumentation(), new ExpressInstrumentation()],
});

configurator.start();
Expand Down

0 comments on commit 78f66a1

Please sign in to comment.