Skip to content

Commit

Permalink
fix: use renamed TraceContextTextMapPropagator
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Aug 26, 2021
1 parent c25bc38 commit e2b5d9f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/grpc-census-prop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ that is already instrumented using OpenCensus.
If both sides of gRPC communication are using OpenTelemetry instrumentation then
the `propagator-grpc-census-binary` propagator isn't required. Context will be
propagated using the `traceparent` header (thanks to the
[HttpTraceContextPropagator](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-core/src/trace/HttpTraceContextPropagator.ts)
[TraceContextTextMapPropagator](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-core/src/trace/TraceContextTextMapPropagator.ts)
propagator from opentelemetry-core). If there is a mix of OpenCensus and OpenTelemetry
instrumentation then the `propagator-grpc-census-binary` propagator allows OpenTelemetry
to propagate context through the `grpc-trace-bin` binary header.
Expand Down
4 changes: 2 additions & 2 deletions examples/grpc-census-prop/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const opentelemetry = require('@opentelemetry/api');
const { NodeTracerProvider } = require('@opentelemetry/node');
const { SimpleSpanProcessor, ConsoleSpanExporter } = require('@opentelemetry/tracing');
const { HttpTraceContextPropagator } = require('@opentelemetry/core');
const { TraceContextTextMapPropagator } = require('@opentelemetry/core');
const { GrpcCensusPropagator } = require('@opentelemetry/propagator-grpc-census-binary');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { GrpcInstrumentation } = require('@opentelemetry/instrumentation-grpc');
Expand All @@ -26,7 +26,7 @@ module.exports = (serviceName, binaryPropagator) => {
});
} else {
provider.register({
propagator: new HttpTraceContextPropagator(),
propagator: new TraceContextTextMapPropagator(),
});
}

Expand Down
4 changes: 2 additions & 2 deletions examples/web/examples/document-load/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xm
import { ZoneContextManager } from '@opentelemetry/context-zone';
import { CollectorTraceExporter } from '@opentelemetry/exporter-collector';
import { B3Propagator } from '@opentelemetry/propagator-b3';
import { CompositePropagator, HttpTraceContextPropagator } from '@opentelemetry/core';
import { CompositePropagator, TraceContextTextMapPropagator } from '@opentelemetry/core';
import { registerInstrumentations } from '@opentelemetry/instrumentation';

const provider = new WebTracerProvider();
Expand All @@ -18,7 +18,7 @@ provider.register({
propagator: new CompositePropagator({
propagators: [
new B3Propagator(),
new HttpTraceContextPropagator(),
new TraceContextTextMapPropagator(),
],
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
TextMapPropagator,
} from '@opentelemetry/api';
import { AWSXRayPropagator } from '@opentelemetry/propagator-aws-xray';
import { HttpTraceContextPropagator } from '@opentelemetry/core';
import { TraceContextTextMapPropagator } from '@opentelemetry/core';

const memoryExporter = new InMemorySpanExporter();
const provider = new NodeTracerProvider();
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('lambda handler', () => {
};
const sampledHttpHeader = serializeSpanContext(
sampledHttpSpanContext,
new HttpTraceContextPropagator()
new TraceContextTextMapPropagator()
);

const unsampledAwsSpanContext: SpanContext = {
Expand All @@ -165,7 +165,7 @@ describe('lambda handler', () => {
};
const unsampledHttpHeader = serializeSpanContext(
unsampledHttpSpanContext,
new HttpTraceContextPropagator()
new TraceContextTextMapPropagator()
);

const sampledGenericSpanContext: SpanContext = {
Expand All @@ -176,7 +176,7 @@ describe('lambda handler', () => {
};
const sampledGenericSpan = serializeSpanContext(
sampledGenericSpanContext,
new HttpTraceContextPropagator()
new TraceContextTextMapPropagator()
);

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-docu
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { B3Propagator } from '@opentelemetry/propagator-b3';
import { CompositePropagator, HttpTraceContextPropagator } from '@opentelemetry/core';
import { CompositePropagator, TraceContextTextMapPropagator } from '@opentelemetry/core';

const provider = new WebTracerProvider();

Expand All @@ -32,7 +32,7 @@ provider.register({
propagator: new CompositePropagator({
propagators: [
new B3Propagator(),
new HttpTraceContextPropagator(),
new TraceContextTextMapPropagator(),
],
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
SpanAttributes,
} from '@opentelemetry/api';
import {
HttpTraceContextPropagator,
TraceContextTextMapPropagator,
TRACE_PARENT_HEADER,
} from '@opentelemetry/core';
import {
Expand Down Expand Up @@ -248,7 +248,7 @@ describe('DocumentLoad Instrumentation', () => {
});

before(() => {
propagation.setGlobalPropagator(new HttpTraceContextPropagator());
propagation.setGlobalPropagator(new TraceContextTextMapPropagator());
});

describe('constructor', () => {
Expand Down
2 changes: 1 addition & 1 deletion propagators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Built-in Propagators

OpenTelemetry core package provides many Built-in Propagators such as HttpTraceContextPropagator Propagator, B3 Propagator, Composite Propagator etc.
OpenTelemetry core package provides many Built-in Propagators such as TraceContextTextMapPropagator Propagator, B3 Propagator, Composite Propagator etc.

[Click here](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-core#built-in-propagators) to see Built-in Propagators.

Expand Down

0 comments on commit e2b5d9f

Please sign in to comment.