diff --git a/detectors/node/resource-detector-deployment/package.json b/detectors/node/resource-detector-deployment/package.json index a042bf01..01a41e72 100644 --- a/detectors/node/resource-detector-deployment/package.json +++ b/detectors/node/resource-detector-deployment/package.json @@ -36,7 +36,7 @@ "@opentelemetry/api": "^1.6.0" }, "dependencies": { - "@opentelemetry/resources": "~1.17.1", + "@opentelemetry/resources": "^1.17.1", "@opentelemetry/semantic-conventions": "^1.17.1", "opentelemetry-resource-detector-sync-api": "^0.29.0" }, diff --git a/detectors/node/resource-detector-git/package.json b/detectors/node/resource-detector-git/package.json index af304641..1c5fb0f6 100644 --- a/detectors/node/resource-detector-git/package.json +++ b/detectors/node/resource-detector-git/package.json @@ -37,7 +37,7 @@ "@opentelemetry/api": "^1.6.0" }, "dependencies": { - "@opentelemetry/resources": "~1.17.1", + "@opentelemetry/resources": "^1.17.1", "@opentelemetry/semantic-conventions": "^1.17.1", "opentelemetry-resource-detector-sync-api": "^0.29.0", "uuid": "^8.3.2" diff --git a/detectors/node/resource-detector-service/package.json b/detectors/node/resource-detector-service/package.json index f7760300..a919b79b 100644 --- a/detectors/node/resource-detector-service/package.json +++ b/detectors/node/resource-detector-service/package.json @@ -36,7 +36,7 @@ "@opentelemetry/api": "^1.6.0" }, "dependencies": { - "@opentelemetry/resources": "~1.17.1", + "@opentelemetry/resources": "^1.17.1", "@opentelemetry/semantic-conventions": "^1.17.1", "opentelemetry-resource-detector-sync-api": "^0.29.0", "uuid": "^8.3.2" diff --git a/detectors/resource-detector-sync-api/package.json b/detectors/resource-detector-sync-api/package.json index 1a8570d8..9eaa75d6 100644 --- a/detectors/resource-detector-sync-api/package.json +++ b/detectors/resource-detector-sync-api/package.json @@ -33,7 +33,7 @@ "@opentelemetry/api": "^1.6.0" }, "dependencies": { - "@opentelemetry/resources": "~1.17.1" + "@opentelemetry/resources": "^1.17.1" }, "devDependencies": { "@opentelemetry/api": "^1.6.0", diff --git a/packages/instrumentation-elasticsearch/package.json b/packages/instrumentation-elasticsearch/package.json index 6c2686ac..e19c7cd9 100644 --- a/packages/instrumentation-elasticsearch/package.json +++ b/packages/instrumentation-elasticsearch/package.json @@ -46,7 +46,7 @@ }, "dependencies": { "@opentelemetry/core": "^1.17.1", - "@opentelemetry/instrumentation": "^0.44.0", + "@opentelemetry/instrumentation": "^0.45.1", "@opentelemetry/semantic-conventions": "^1.17.1" }, "devDependencies": { diff --git a/packages/instrumentation-express/package.json b/packages/instrumentation-express/package.json index ca28cb22..e770663c 100644 --- a/packages/instrumentation-express/package.json +++ b/packages/instrumentation-express/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@opentelemetry/core": "^1.17.1", - "@opentelemetry/instrumentation": "^0.44.0", + "@opentelemetry/instrumentation": "^0.45.1", "@opentelemetry/semantic-conventions": "^1.17.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.7" diff --git a/packages/instrumentation-kafkajs/package.json b/packages/instrumentation-kafkajs/package.json index bae6b983..4ae7c39d 100644 --- a/packages/instrumentation-kafkajs/package.json +++ b/packages/instrumentation-kafkajs/package.json @@ -38,7 +38,7 @@ "@opentelemetry/api": "^1.6.0" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.44.0", + "@opentelemetry/instrumentation": "^0.45.1", "@opentelemetry/semantic-conventions": "^1.17.1" }, "devDependencies": { diff --git a/packages/instrumentation-kafkajs/src/kafkajs.ts b/packages/instrumentation-kafkajs/src/kafkajs.ts index 6c7bb711..32b6308f 100644 --- a/packages/instrumentation-kafkajs/src/kafkajs.ts +++ b/packages/instrumentation-kafkajs/src/kafkajs.ts @@ -1,15 +1,4 @@ -import { - SpanKind, - Span, - SpanStatusCode, - Context, - propagation, - Link, - trace, - context, - diag, - ROOT_CONTEXT, -} from '@opentelemetry/api'; +import { SpanKind, Span, SpanStatusCode, Context, propagation, Link, trace, context, diag } from '@opentelemetry/api'; import { SemanticAttributes, MessagingOperationValues, @@ -137,7 +126,7 @@ export class KafkaJsInstrumentation extends InstrumentationBase const self = this; return function (payload: EachMessagePayload): Promise { const propagatedContext: Context = propagation.extract( - ROOT_CONTEXT, + context.active(), payload.message.headers, bufferTextMapGetter ); @@ -163,12 +152,12 @@ export class KafkaJsInstrumentation extends InstrumentationBase payload.batch.topic, undefined, MessagingOperationValues.RECEIVE, - ROOT_CONTEXT + context.active() ); return context.with(trace.setSpan(context.active(), receivingSpan), () => { const spans = payload.batch.messages.map((message: KafkaMessage) => { const propagatedContext: Context = propagation.extract( - ROOT_CONTEXT, + context.active(), message.headers, bufferTextMapGetter ); diff --git a/packages/instrumentation-kafkajs/test/kafkajs.spec.ts b/packages/instrumentation-kafkajs/test/kafkajs.spec.ts index c9e954dd..9ad9cf44 100644 --- a/packages/instrumentation-kafkajs/test/kafkajs.spec.ts +++ b/packages/instrumentation-kafkajs/test/kafkajs.spec.ts @@ -5,6 +5,7 @@ import { ReadableSpan } from '@opentelemetry/sdk-trace-base'; import { propagation, context, SpanKind, SpanStatusCode, Span } from '@opentelemetry/api'; import { MessagingDestinationKindValues, SemanticAttributes } from '@opentelemetry/semantic-conventions'; import { getTestSpans, registerInstrumentationTesting } from '@opentelemetry/contrib-test-utils'; +import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; const instrumentation = registerInstrumentationTesting(new KafkaJsInstrumentation()); @@ -26,6 +27,7 @@ import { DummyPropagation } from './DummyPropagation'; import { W3CBaggagePropagator, CompositePropagator } from '@opentelemetry/core'; describe('instrumentation-kafkajs', () => { + context.setGlobalContextManager(new AsyncHooksContextManager()); propagation.setGlobalPropagator( new CompositePropagator({ propagators: [new DummyPropagation(), new W3CBaggagePropagator()] }) ); diff --git a/packages/instrumentation-neo4j/package.json b/packages/instrumentation-neo4j/package.json index a7f19ebb..5e5e813e 100644 --- a/packages/instrumentation-neo4j/package.json +++ b/packages/instrumentation-neo4j/package.json @@ -44,7 +44,7 @@ "@opentelemetry/api": "^1.6.0" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.44.0", + "@opentelemetry/instrumentation": "^0.45.1", "@opentelemetry/semantic-conventions": "^1.17.1" }, "devDependencies": { diff --git a/packages/instrumentation-node-cache/package.json b/packages/instrumentation-node-cache/package.json index cd1ed0d9..adc97d97 100644 --- a/packages/instrumentation-node-cache/package.json +++ b/packages/instrumentation-node-cache/package.json @@ -44,7 +44,7 @@ "dependencies": { "@opentelemetry/contrib-test-utils": "^0.34.2", "@opentelemetry/core": "^1.17.1", - "@opentelemetry/instrumentation": "^0.44.0", + "@opentelemetry/instrumentation": "^0.45.1", "@opentelemetry/semantic-conventions": "^1.17.1" }, "devDependencies": { diff --git a/packages/instrumentation-sequelize/package.json b/packages/instrumentation-sequelize/package.json index f1bd6a5f..cdf1392b 100644 --- a/packages/instrumentation-sequelize/package.json +++ b/packages/instrumentation-sequelize/package.json @@ -43,7 +43,7 @@ }, "dependencies": { "@opentelemetry/core": "^1.17.1", - "@opentelemetry/instrumentation": "^0.44.0", + "@opentelemetry/instrumentation": "^0.45.1", "@opentelemetry/semantic-conventions": "^1.17.1" }, "devDependencies": { diff --git a/packages/instrumentation-typeorm/package.json b/packages/instrumentation-typeorm/package.json index c403df3a..c33da1e0 100644 --- a/packages/instrumentation-typeorm/package.json +++ b/packages/instrumentation-typeorm/package.json @@ -39,7 +39,7 @@ }, "dependencies": { "@opentelemetry/core": "^1.17.1", - "@opentelemetry/instrumentation": "^0.44.0", + "@opentelemetry/instrumentation": "^0.45.1", "@opentelemetry/semantic-conventions": "^1.17.1", "is-promise": "^4.0.0" },