File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
5
5
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express' ;
6
6
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node' ;
7
7
const apikey = process . env . BACKEND_TRACING_API_KEY ;
8
+ const tracingEnabledEnv = process . env . BACKEND_TRACING_ENABLED ;
8
9
9
10
const googleExporter = new OTLPTraceExporter ( {
10
11
url : 'http://opentelemetry-collector.monitoring.svc.cluster.local:4318/v1/traces' ,
@@ -24,7 +25,7 @@ export const otelSDK = new NodeSDK({
24
25
] ,
25
26
} ) ;
26
27
27
- export const tracingEnabled = ! ! apikey ;
28
+ export const tracingEnabled = ! ! apikey || tracingEnabledEnv === 'true' ;
28
29
29
30
// gracefully shut down the SDK on process exit
30
31
process . on ( 'SIGTERM' , ( ) => {
You can’t perform that action at this time.
0 commit comments