Skip to content

Commit

Permalink
fix(tracing): change in semantic and span processor
Browse files Browse the repository at this point in the history
  • Loading branch information
rudemex committed Jun 3, 2024
1 parent 4e19e03 commit 65c65a8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/tracing/src/tracing/providers/otel.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
import { NodeSDK } from '@opentelemetry/sdk-node';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import {
SEMRESATTRS_SERVICE_NAME,
SEMRESATTRS_SERVICE_VERSION,
} from '@opentelemetry/semantic-conventions';
import { AWSXRayIdGenerator } from '@opentelemetry/id-generator-aws-xray';
import {
CompositePropagator,
Expand Down Expand Up @@ -38,15 +41,15 @@ export const otelProvider = (_options: TracingOptions): void => {
const spanProcessor = new BatchSpanProcessor(traceExporter);

const resource = new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: resourceAttributes.serviceName,
[SemanticResourceAttributes.SERVICE_VERSION]: resourceAttributes.version,
[SEMRESATTRS_SERVICE_NAME]: resourceAttributes.serviceName,
[SEMRESATTRS_SERVICE_VERSION]: resourceAttributes.version,
...resourceAttributes,
});

new NodeSDK({
resource,
idGenerator: new AWSXRayIdGenerator(),
spanProcessor,
spanProcessors: [spanProcessor],
textMapPropagator: new CompositePropagator({
propagators: [
new AWSXRayPropagator(),
Expand Down

0 comments on commit 65c65a8

Please sign in to comment.