File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
aws-distro-opentelemetry-node-autoinstrumentation/src Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -256,14 +256,13 @@ export class AwsOpentelemetryConfigurator {
256256
257257 // Register BatchUnsampledSpanProcessor to export unsampled traces in Lambda
258258 // when Application Signals enabled
259- if ( isLambdaEnvironment ( ) ) {
259+ if ( isLambdaEnvironment ( ) && ! hasCustomOtlpTraceEndpoint ( ) ) {
260+ const udpSpanExporter = new OTLPUdpSpanExporter ( getXrayDaemonEndpoint ( ) , FORMAT_OTEL_UNSAMPLED_TRACES_BINARY_PREFIX ) ;
261+ const configuredExporter = AwsMetricAttributesSpanExporterBuilder . create ( udpSpanExporter , resource ) . build ( ) ;
260262 spanProcessors . push (
261- new AwsBatchUnsampledSpanProcessor (
262- new OTLPUdpSpanExporter ( getXrayDaemonEndpoint ( ) , FORMAT_OTEL_UNSAMPLED_TRACES_BINARY_PREFIX ) ,
263- {
264- maxExportBatchSize : getSpanExportBatchSize ( ) ,
265- }
266- )
263+ new AwsBatchUnsampledSpanProcessor ( configuredExporter , {
264+ maxExportBatchSize : getSpanExportBatchSize ( ) ,
265+ } )
267266 ) ;
268267 diag . info ( 'Enabled batch unsampled span processor for Lambda environment.' ) ;
269268 }
You can’t perform that action at this time.
0 commit comments