Skip to content

Commit 7898e0c

Browse files
authored
fix: remove default global trace context propagator (#2209)
Fixes #2208
1 parent 8d89b9a commit 7898e0c

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ import * as v1 from './v1';
8585
import {
8686
ObservabilityOptions,
8787
ensureInitialContextManagerSet,
88-
ensureContextPropagation,
8988
} from './instrument';
9089

9190
// eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -378,7 +377,6 @@ class Spanner extends GrpcService {
378377
this._observabilityOptions?.enableEndToEndTracing
379378
);
380379
ensureInitialContextManagerSet();
381-
ensureContextPropagation();
382380
}
383381

384382
/**

src/instrument.ts

-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
Span,
2828
SpanStatusCode,
2929
context,
30-
propagation,
3130
trace,
3231
INVALID_SPAN_CONTEXT,
3332
ROOT_CONTEXT,
@@ -100,8 +99,6 @@ const {
10099
AsyncHooksContextManager,
101100
} = require('@opentelemetry/context-async-hooks');
102101

103-
const {W3CTraceContextPropagator} = require('@opentelemetry/core');
104-
105102
/*
106103
* This function ensures that async/await works correctly by
107104
* checking if context.active() returns an invalid/unset context
@@ -121,14 +118,8 @@ function ensureInitialContextManagerSet() {
121118
}
122119
}
123120

124-
function ensureContextPropagation() {
125-
propagation.setGlobalPropagator(new W3CTraceContextPropagator());
126-
}
127-
128121
export {ensureInitialContextManagerSet};
129122

130-
export {ensureContextPropagation};
131-
132123
/**
133124
* startTrace begins an active span in the current active context
134125
* and passes it back to the set callback function. Each span will

0 commit comments

Comments
 (0)