Repository navigation
feat!: upgrade OpenTelemetry for 2.x - #24
Merged
Merged
Conversation
Align experimental packages on 0.223.0 and the auto-instrumentation bundle on 0.81.2. Adapt log processor construction and verify real log export and custom trace exporter fan-out. Refresh compatible transitive dependencies and Assembler. BREAKING CHANGE: HTTP and database instrumentation emit stable-only conventions. HTTP duration metrics use new names and seconds. V8 heap metrics, Fastify auto-instrumentation, and custom log SDK APIs require migration. Amp-Thread-ID: https://ampcode.com/threads/T-01a14eca-ade1-74c9-b1a1-415d59c46b17
Cover HTTP and database attributes, metric names and units, runtime heap metrics, removed Fastify instrumentation, and custom SDK API changes. Amp-Thread-ID: https://ampcode.com/threads/T-01a14eca-ade1-74c9-b1a1-415d59c46b17
Keep the README unchanged and retain migration details in the pull request for the 2.0 release notes. Amp-Thread-ID: https://ampcode.com/threads/T-01a14eca-ade1-74c9-b1a1-415d59c46b17
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.
Prepare the next major release
This PR starts from
1.2.4and targets2.x, leaving1.xunchanged.It upgrades the experimental OpenTelemetry packages to
0.223.0and the auto-instrumentation bundle to0.81.2. Stable SDK packages remain on2.12.0. It adapts log processor construction, updates Assembler, and refreshes compatible transitive dependencies.The
destinations.otlp()configuration stays unchanged. A major release is required because emitted telemetry and some SDK APIs change. The package version remains1.2.4until release preparation; this PR does not publish a package.Breaking changes and migration
HTTP attributes and duration units change
http.methodhttp.request.methodhttp.status_codehttp.response.status_codehttp.urlurl.fullhttp.targeturl.pathandurl.queryon server spanshttp.user_agentuser_agent.originalhttp.server.duration/http.client.duration, in millisecondshttp.server.request.duration/http.client.request.duration, in secondsUpdate queries, dashboards, and thresholds: 500 ms becomes 0.5 seconds.
http.routeis unchanged.OTEL_SEMCONV_STABILITY_OPT_IN=http/dupno longer restores legacy output. Sensitive server URL query parameters are redacted by default.Database instrumentations emit stable conventions only
For affected instrumentations, replace
db.system,db.name,db.statement, anddb.operationwithdb.system.name,db.namespace,db.query.text, anddb.operation.name. Replacenet.peer.nameandnet.peer.portwithserver.addressandserver.port.db.useranddb.connection_stringare removed without automatic replacements. Legacy and duplicate modes no longer preserve the old output. OracleDB now usesDB_UNIQUE_NAMEfordb.namespace. MySQL and MongoDB renamedb.client.connections.usagetodb.client.connection.count.Our defaults still disable PostgreSQL, MySQL, and MySQL2 instrumentation unless explicitly enabled.
Runtime metrics and Fastify instrumentation change
v8js.memory.heap.limitis removed.v8js.memory.heap.space.sizemeasures allocated space, not the maximum heap limit. The new instrument is an up/down counter exported as a non-monotonic Sum, rather than a Gauge. Update storage queries as well as metric names.v8js.memory.heap.usedremains a per-space Gauge.@fastify/otelif needed. AdonisJS HTTP instrumentation remains available.Custom SDK components need API updates
new BatchLogRecordProcessor({ exporter, ...options })andnew SimpleLogRecordProcessor({ exporter }). Do not apply this change to trace processors.forceFlush(). Pass the provider timeout toforceFlush({ timeoutMillis }).LoggerOptions.scopeAttributesbecomesattributes. Replace the old no-op logger exports withcreateNoopLogger(). Custom Logger implementations must provideenabled().headersin their configuration types. Usemetadata. The old option was already ignored at runtime; HTTP exporters still supportheaders.For log processor option types, replace
BufferConfigwithBatchLogRecordProcessorOptionsandBatchLogRecordProcessorBrowserConfigwithBatchLogRecordProcessorBrowserOptions.If you use the separate OpenTelemetry declarative configuration entrypoint, rename
OTEL_EXPERIMENTAL_CONFIG_FILEtoOTEL_CONFIG_FILEand review its schema changes. This package still constructsNodeSDKdirectly.See the SDK changelog, HTTP instrumentation documentation, and database/network migration.
Keep this migration guidance in the 2.0 release notes. The README is unchanged.
Verification and limitations
npm ci.npm ls --all, Prettier, andgit diff --checkpass.npm audit --omit=dev: 0 reported vulnerabilities.bracesandbasic-ftpin development tools.braceshas no published fixed version;get-uristill depends onbasic-ftp5.x. No forced overrides were added.npm audit signatures: 801 registry signatures and 271 attestations verified.Two direct dependencies intentionally remain behind their latest versions: TypeScript 6, because Assembler and typescript-eslint do not yet support TS7, and @types/node 25, because testing 26.6.5 produces errors in the diagnostics-channel types used by Adonis.
These tests do not establish compatibility with every downstream driver or dashboard. Loader changes, bootstrap extensions, and new exception or destination APIs discussed for later work are outside this PR.