Skip to content

build(deps): move OpenTelemetry to the 3.x SDK and 0.300 exporters - #159

Merged
semics-tech merged 2 commits into
mainfrom
agent/otel-3x
Nov 3, 2026
Merged

semics-tech merged 2 commits into
mainfrom
agent/otel-3x

Conversation

@semics-tech

Copy link
Copy Markdown
Owner

Supersedes #153 (sdk-logs 0.223 -> 3.0.0) and #154 (resources 2.12 -> 3.0.0). Both can be closed once this merges. I haven't touched the .github bumps #122-#126.

Why #153/#154 failed

  • Dependency audit: not caused by OpenTelemetry. Both dependabot branches are based on an older main, so their lockfiles still pin node-forge@1.4.0 (6 high advisories, patched in 1.4.1). main already has node-forge ^1.4.2, so basing on current main clears it. No audit config change needed.
  • Demo compose stack (build(deps): bump @opentelemetry/sdk-logs from 0.223.0 to 3.0.0 #153 only): seed exited 1 on the stale base. I couldn't pull the seed log out of the CI output, so this is unconfirmed. Please check that this PR's Compose smoke run is green; if it isn't, the seed log is the thing to read.

Changes

  • @opentelemetry/resources ^3.0.0, @opentelemetry/sdk-logs ^3.0.0. The exporters stay on ^0.300.0, which depend on sdk-logs/sdk-trace 3.0.0.
  • sdk-trace-base and sdk-trace-node have no 3.x release. They're deprecated for @opentelemetry/sdk-trace, which 3.0.0 and the 0.300 trace exporter use. Tracing therefore moves to @opentelemetry/sdk-trace ^3.0.0 plus @opentelemetry/context-async-hooks ^3.0.0. This leaves a single copy of each OTel package in the lockfile.
  • @opentelemetry/api stays at ^1.10.0, which the 3.x peer range (>=1.10 <1.11) needs. api-logs stays at 0.223.0, the latest published; sdk-logs 3 no longer depends on it.
  • packages/server/src/tracing.ts migration:
    • NodeTracerProvider becomes TracerProvider.
    • provider.register() no longer exists, so the global provider and an AsyncLocalStorageContextManager are set explicitly, and stopTracing disables them again.
    • BatchSpanProcessor and SimpleSpanProcessor now take { exporter }.
  • The two existing tracing tests are updated to the new imports.
  • New packages/server/test/tracing.test.ts needs no database. It checks that the provider is registered, the active span survives an await, sample ratio 0 drops spans, and stopTracing resets to no-op.
  • LoggerProvider and BatchLogRecordProcessor in audit-export.ts needed no source change.

Node

No bump needed: engines, the Dockerfile (node:24-bookworm-slim) and CI (NODE_VERSION: 24) are already above the 22.15 floor.

Verification (local, host Node 24.21)

  • pnpm lint: 0 errors. The one warning is in Admin.tsx.
  • pnpm typecheck: clean.
  • vitest --project server test/tracing.test.ts: 5/5 pass.
  • Not run locally: the Postgres-backed server tests, including the two updated tracing tests. The sandbox can't bind ports and containers have no network, so I couldn't run them in Docker. CI's Unit tests job is the check for those.

Risk for the 10 Nov post

Low. The change is confined to the opt-in tracing and audit-export paths, and both are off by default. Runtime behaviour is unchanged, apart from the explicit context-manager registration needed on 3.x. The main residual risk is OTLP export against a real collector, which no test here covers.

🤖 Generated with Claude Code


Draft opened by Oli's repos agent.

Supersedes the dependabot bumps of sdk-logs and resources, which could not
land on their own: 3.x peers on api >=1.10 <1.11 and the stable packages
only pair with the 0.300 exporters. sdk-trace-base and sdk-trace-node have no
3.x release (deprecated for sdk-trace), so tracing moves to sdk-trace plus
context-async-hooks. NodeTracerProvider.register() is gone, so the global
provider and context manager are set explicitly. Batch and simple span
processors now take an options object.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@semics-tech
semics-tech marked this pull request as ready for review October 31, 2026 07:17
# Conflicts:
#	packages/server/package.json
#	pnpm-lock.yaml
@semics-tech
semics-tech merged commit be912a7 into main Nov 3, 2026
12 checks passed
@semics-tech
semics-tech deleted the agent/otel-3x branch November 3, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant