Skip to content

Commit e72d385

Browse files
committed
✨ add tracing enabled env to deprecate unused backend tracing api key env
1 parent 8148ac3 commit e72d385

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tracing/tracing-initializer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
55
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
66
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
77
const apikey = process.env.BACKEND_TRACING_API_KEY;
8+
const tracingEnabledEnv = process.env.BACKEND_TRACING_ENABLED;
89

910
const googleExporter = new OTLPTraceExporter({
1011
url: 'http://opentelemetry-collector.monitoring.svc.cluster.local:4318/v1/traces',
@@ -24,7 +25,7 @@ export const otelSDK = new NodeSDK({
2425
],
2526
});
2627

27-
export const tracingEnabled = !!apikey;
28+
export const tracingEnabled = !!apikey || tracingEnabledEnv === 'true';
2829

2930
// gracefully shut down the SDK on process exit
3031
process.on('SIGTERM', () => {

0 commit comments

Comments
 (0)