Skip to content

Commit

Permalink
fix: remove default global trace context propagator (#2209)
Browse files Browse the repository at this point in the history
Fixes #2208
  • Loading branch information
surbhigarg92 authored Jan 3, 2025
1 parent 8d89b9a commit 7898e0c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ import * as v1 from './v1';
import {
ObservabilityOptions,
ensureInitialContextManagerSet,
ensureContextPropagation,
} from './instrument';

// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand Down Expand Up @@ -378,7 +377,6 @@ class Spanner extends GrpcService {
this._observabilityOptions?.enableEndToEndTracing
);
ensureInitialContextManagerSet();
ensureContextPropagation();
}

/**
Expand Down
9 changes: 0 additions & 9 deletions src/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
Span,
SpanStatusCode,
context,
propagation,
trace,
INVALID_SPAN_CONTEXT,
ROOT_CONTEXT,
Expand Down Expand Up @@ -100,8 +99,6 @@ const {
AsyncHooksContextManager,
} = require('@opentelemetry/context-async-hooks');

const {W3CTraceContextPropagator} = require('@opentelemetry/core');

/*
* This function ensures that async/await works correctly by
* checking if context.active() returns an invalid/unset context
Expand All @@ -121,14 +118,8 @@ function ensureInitialContextManagerSet() {
}
}

function ensureContextPropagation() {
propagation.setGlobalPropagator(new W3CTraceContextPropagator());
}

export {ensureInitialContextManagerSet};

export {ensureContextPropagation};

/**
* startTrace begins an active span in the current active context
* and passes it back to the set callback function. Each span will
Expand Down

0 comments on commit 7898e0c

Please sign in to comment.