From 16d35157686602b5b3756b16ec9ec4427240f692 Mon Sep 17 00:00:00 2001 From: Julien Fabre Date: Mon, 7 Sep 2020 18:51:49 +0200 Subject: [PATCH] fix: new version with TextMapPropagator interface (#196) Co-authored-by: Bartlomiej Obecny --- .../package.json | 5 ++--- .../src/GrpcCensusPropagator.ts | 6 +++--- .../test/GrpcCensusPropagator.test.ts | 3 +-- propagators/opentelemetry-propagator-jaeger/package.json | 4 ++-- .../src/JaegerHttpTracePropagator.ts | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/propagators/opentelemetry-propagator-grpc-census-binary/package.json b/propagators/opentelemetry-propagator-grpc-census-binary/package.json index d1166d3862..cf28681e2b 100644 --- a/propagators/opentelemetry-propagator-grpc-census-binary/package.json +++ b/propagators/opentelemetry-propagator-grpc-census-binary/package.json @@ -42,7 +42,6 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/context-base": "0.10.2", "@types/mocha": "7.0.2", "@types/node": "14.0.27", "codecov": "3.7.2", @@ -59,7 +58,7 @@ "typescript": "3.9.7" }, "dependencies": { - "@opentelemetry/api": "^0.10.2", - "@opentelemetry/core": "^0.10.2" + "@opentelemetry/api": "^0.11.0", + "@opentelemetry/core": "^0.11.0" } } diff --git a/propagators/opentelemetry-propagator-grpc-census-binary/src/GrpcCensusPropagator.ts b/propagators/opentelemetry-propagator-grpc-census-binary/src/GrpcCensusPropagator.ts index c37a88a1c3..e6c5923d84 100644 --- a/propagators/opentelemetry-propagator-grpc-census-binary/src/GrpcCensusPropagator.ts +++ b/propagators/opentelemetry-propagator-grpc-census-binary/src/GrpcCensusPropagator.ts @@ -17,7 +17,7 @@ import { Context, GetterFunction, - HttpTextPropagator, + TextMapPropagator, SetterFunction, } from '@opentelemetry/api'; import { @@ -53,11 +53,11 @@ function isValidSpanId(spanId: string): boolean { /** * Propagator for the grpc-trace-bin header used by OpenCensus for - * gRPC. Acts as a bridge between the HttpTextPropagator interface and + * gRPC. Acts as a bridge between the TextMapPropagator interface and * the binary encoding/decoding that happens in the supporting * BinaryTraceContext class. */ -export class GrpcCensusPropagator implements HttpTextPropagator { +export class GrpcCensusPropagator implements TextMapPropagator { /** * Injects trace propagation context into the carrier after encoding * in binary format diff --git a/propagators/opentelemetry-propagator-grpc-census-binary/test/GrpcCensusPropagator.test.ts b/propagators/opentelemetry-propagator-grpc-census-binary/test/GrpcCensusPropagator.test.ts index 4cc644b23d..f9c7d60079 100644 --- a/propagators/opentelemetry-propagator-grpc-census-binary/test/GrpcCensusPropagator.test.ts +++ b/propagators/opentelemetry-propagator-grpc-census-binary/test/GrpcCensusPropagator.test.ts @@ -15,8 +15,7 @@ */ import * as assert from 'assert'; -import { SpanContext, TraceFlags } from '@opentelemetry/api'; -import { Context } from '@opentelemetry/context-base'; +import { SpanContext, TraceFlags, Context } from '@opentelemetry/api'; import { getExtractedSpanContext, setExtractedSpanContext, diff --git a/propagators/opentelemetry-propagator-jaeger/package.json b/propagators/opentelemetry-propagator-jaeger/package.json index 214f3e78bb..dea0333c67 100644 --- a/propagators/opentelemetry-propagator-jaeger/package.json +++ b/propagators/opentelemetry-propagator-jaeger/package.json @@ -70,7 +70,7 @@ "webpack": "4.43.0" }, "dependencies": { - "@opentelemetry/api": "^0.10.1", - "@opentelemetry/core": "^0.10.1" + "@opentelemetry/api": "^0.11.0", + "@opentelemetry/core": "^0.11.0" } } diff --git a/propagators/opentelemetry-propagator-jaeger/src/JaegerHttpTracePropagator.ts b/propagators/opentelemetry-propagator-jaeger/src/JaegerHttpTracePropagator.ts index c36afe339f..7f1b64bd8f 100644 --- a/propagators/opentelemetry-propagator-jaeger/src/JaegerHttpTracePropagator.ts +++ b/propagators/opentelemetry-propagator-jaeger/src/JaegerHttpTracePropagator.ts @@ -16,7 +16,7 @@ import { Context, - HttpTextPropagator, + TextMapPropagator, SpanContext, TraceFlags, SetterFunction, @@ -44,7 +44,7 @@ export const UBER_TRACE_ID_HEADER = 'uber-trace-id'; * One byte bitmap, as two hex digits. * Inspired by jaeger-client-node project. */ -export class JaegerHttpTracePropagator implements HttpTextPropagator { +export class JaegerHttpTracePropagator implements TextMapPropagator { private readonly _jaegerTraceHeader: string; /**