File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -56,20 +56,22 @@ if (tracingEnabled && endpoint) {
5656 } )
5757}
5858
59- // Create a BatchSpanProcessor using the trace exporter
60- const batchProcessor = traceExporter ? new BatchSpanProcessor ( traceExporter ) : undefined
61-
6259const spanProcessors : SpanProcessor [ ] = [ ]
6360
64- if ( tracingEnabled ) {
61+ if ( tracingEnabled && traceExporter ) {
6562 spanProcessors . push ( new TenantSpanProcessor ( ) )
63+ spanProcessors . push ( new BatchSpanProcessor ( traceExporter ) )
64+ } else if ( tracingEnabled ) {
65+ logSchema . warning (
66+ logger ,
67+ '[Otel] TRACING_ENABLED=true but no OTLP trace endpoint configured; skipping tracing SDK startup' ,
68+ {
69+ type : 'otel' ,
70+ }
71+ )
6672}
6773
68- if ( batchProcessor ) {
69- spanProcessors . push ( batchProcessor )
70- }
71-
72- if ( tracingEnabled && spanProcessors . length > 0 ) {
74+ if ( tracingEnabled && traceExporter && spanProcessors . length > 0 ) {
7375 // Configure the OpenTelemetry Node SDK
7476 const sdk = new NodeSDK ( {
7577 resource : resourceFromAttributes ( {
You can’t perform that action at this time.
0 commit comments