Repository navigation
feat!: require OpenTelemetry JS SDK 3 - #36
Merged
Merged
Conversation
SDK 3 packages declare an `@opentelemetry/api` peer of `>=1.10.0 <1.11.0` while `@opentelemetry/core` 2 requires `api <1.10.0`, so an application cannot install SDK 2 and SDK 3 packages side by side. The optional peers only accepted SDK 2, which blocked every application moving to SDK 3. The peers now require `api` ^1.10.0, `core` ^3.0.0 and `instrumentation` >=0.300.0 <0.400.0. The instrumentation code needed no change. The tests move from the removed `@opentelemetry/sdk-trace-base` to `@opentelemetry/sdk-trace`. BREAKING CHANGE: the OpenTelemetry instrumentation requires OpenTelemetry JS SDK 3. Applications on SDK 2 should stay on 0.9.x.
…rsion The instrumentation passed a hardcoded '0.1.0' to InstrumentationBase, so every span carried a scope version unrelated to the installed package. Read the name and version from package.json instead.
A dispatch with `.dedup()` that did not add a job still produced a PRODUCER span with the ID generated for the discarded job, an ID that never exists in the queue, and nothing told it apart from a dispatch that added one. The caller, meanwhile, gets the ID of the existing job. The dispatch message now carries the ID of the job that holds the dedup key, and the PRODUCER span reports it as `messaging.message.id` with the outcome in `messaging.job.dedup_outcome`.
QueueManager keeps the execution wrapper it received from the patched init(), so after disable() it still started a CONSUMER span for every job. The execute subscription that ends those spans was gone: they never ended and the map that tracks them grew with each execution. The wrapper now runs the job without a span when the instrumentation is not subscribed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the OpenTelemetry instrumentation to OpenTelemetry JS SDK 3 and fixes three bugs found while testing it against a real AdonisJS application.
SDK 3
SDK 3 packages declare an
@opentelemetry/apipeer of>=1.10.0 <1.11.0, and@opentelemetry/core2 requiresapi <1.10.0, so one release cannot support both SDKs. The optional peers move toapi^1.10.0,core^3.0.0 andinstrumentation>=0.300.0 <0.400.0. The instrumentation code needed no change; the tests move from the removedsdk-trace-basetosdk-trace.This is a breaking change: applications on SDK 2 stay on 0.9.x.
@adonisjs/queuedepends on@boringnode/queue^0.9.0 and needs a release with the new range.Fixes
.dedup()reported a job ID that never exists in the queue. The PRODUCER span now reports the ID of the existing job andmessaging.job.dedup_outcome.disable(): the execution wrapper kept starting CONSUMER spans that nothing ended, and their map grew with each job. The wrapper now runs the job without a span when the instrumentation is not subscribed.0.1.0; they now carry the package version.Verification
@adonisjs/oteland Jaeger, in dev and fromnode ace build: one copy each ofapi1.10.0,core3.1.1 andinstrumentation0.301.1. HTTP dispatch, nested dispatch, batch, delayed, retries, permanent failure, timeout, dedup, sync and database adapters, scheduled jobs, 10 concurrent jobs, and bothlinkandparentmodes produce correctly parented and linked spans, with no span from worker polling.