Skip to content

Commit

Permalink
fix: propagate trace context
Browse files Browse the repository at this point in the history
  • Loading branch information
stevoland committed Feb 15, 2024
1 parent 07c2336 commit 44e2930
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tracing.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const opentelemetry = require('@opentelemetry/sdk-node')
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc')
const { Resource } = require('@opentelemetry/resources')
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions')
const { W3CTraceContextPropagator } = require('@opentelemetry/core')

const { OTEL_EXPORTER_OTLP_ENDPOINT } = process.env

Expand All @@ -14,6 +15,7 @@ if (OTEL_EXPORTER_OTLP_ENDPOINT) {
})

const sdk = new opentelemetry.NodeSDK({
textMapPropagator: new W3CTraceContextPropagator(),
traceExporter,
instrumentations: [
new HttpInstrumentation({
Expand Down

0 comments on commit 44e2930

Please sign in to comment.