Skip to content

Support OpenTelemetry SDK 3.x in @effect/opentelemetry - #10339

Merged
tim-smart merged 2 commits into
v4/next-minorfrom
agent/nelson-effect-bot/e71d4993ed70
Nov 4, 2026
Merged

tim-smart merged 2 commits into
v4/next-minorfrom
agent/nelson-effect-bot/e71d4993ed70

Conversation

@effect-bot

@effect-bot effect-bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Moves @effect/opentelemetry to OpenTelemetry JS SDK 3.x and drops 2.x support. The two can't be supported together: every 2.x SDK package requires @opentelemetry/api <1.10.0, while 3.x requires >=1.10.0 and moves the logs API (SeverityNumber) into @opentelemetry/api.

Changes

Peers (packages/opentelemetry/package.json)

Peer Before After
@opentelemetry/api >=1.9.0 <2.0.0 >=1.10.0 <2.0.0
@opentelemetry/api-logs >=0.203.0 <0.300.0 removed
@opentelemetry/sdk-trace-base / -node / -web >=2.0.0 <3.0.0 removed
@opentelemetry/sdk-trace none >=3.0.0 <4.0.0, optional
@opentelemetry/sdk-logs >=0.203.0 <0.300.0 >=3.0.0 <4.0.0
@opentelemetry/sdk-metrics, @opentelemetry/resources >=2.0.0 <3.0.0 >=3.0.0 <4.0.0

Source

  • NodeSdk and WebSdk build a TracerProvider from @opentelemetry/sdk-trace instead of NodeTracerProvider / WebTracerProvider. tracerConfig now takes TracerProviderOptions and is passed straight to the provider. loggerProviderConfig now takes LoggerProviderOptions.
  • OtelLogger imports SeverityNumber from @opentelemetry/api. layerLoggerProvider takes LoggerProviderOptions.
  • internal/metrics.ts replaces the deep sdk-metrics/build/src/InstrumentDescriptor.js import, which the 3.x exports map no longer allows, with the public MetricDescriptor. Descriptors no longer carry type or advice, because the 3.x descriptor dropped both.

The lockfile changes only OpenTelemetry entries.

Tests are in a separate commit: 3.x imports, the { exporter } processor options, updated metric descriptor expectations, and a new WebSdk.test.ts.

Release and migration

There is a minor changeset for @effect/opentelemetry. The APIs are @stability unstable. This is a breaking change in peers, option types and behaviour, and the changeset covers each of these:

  • The peer changes.
  • Importing processors, exporters and samplers from @opentelemetry/sdk-trace, and SeverityNumber from @opentelemetry/api.
  • The new BatchSpanProcessor({ exporter }) constructor change, and that BatchSpanProcessor no longer reads OTEL_BSP_*.
  • SDK 3.x removed environment-based tracer configuration, so NodeSdk no longer reads OTEL_TRACES_SAMPLER, OTEL_TRACES_SAMPLER_ARG or the OTEL_SPAN_* / OTEL_ATTRIBUTE_* limits. The changeset includes a tracerConfig.sampler / tracerConfig.spanLimits example to use instead.
  • Metric descriptors no longer include type and advice.

Validation (on v4/next-minor)

  • pnpm check (root, including tsconfig.tests.json): passes
  • pnpm test --run packages/opentelemetry/test: 53/53 pass
  • pnpm lint: passes
  • pnpm --filter @effect/opentelemetry build: passes

Closes #10328
Closes EFF-3324

@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f7fbad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
@effect/opentelemetry Minor
effect Minor
@effect/vitest Minor
@effect/ai-anthropic Minor
@effect/ai-cloudflare Minor
@effect/ai-openai-compat Minor
@effect/ai-openai Minor
@effect/ai-openrouter Minor
@effect/ai-typesafe Minor
@effect/atom-react Minor
@effect/atom-solid Minor
@effect/atom-vue Minor
@effect/platform-browser Minor
@effect/platform-bun Minor
@effect/platform-deno Minor
@effect/platform-node-shared Minor
@effect/platform-node Minor
@effect/sql-clickhouse Minor
@effect/sql-d1 Minor
@effect/sql-libsql Minor
@effect/sql-mssql Minor
@effect/sql-mysql2 Minor
@effect/sql-pg Minor
@effect/sql-pglite Minor
@effect/sql-sqlite-bun Minor
@effect/sql-sqlite-do Minor
@effect/sql-sqlite-node Minor
@effect/sql-sqlite-react-native Minor
@effect/sql-sqlite-wasm Minor
@effect/docgen Minor
@effect/doctest Minor
@effect/graphql-generator Minor
@effect/openapi-generator Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-janitor effect-janitor Bot added the 4.0 label Nov 3, 2026
@effect-bot
effect-bot changed the base branch from main to v4/next-minor November 3, 2026 20:07
@effect-janitor effect-janitor Bot removed the 4.0 label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.41 KB 39.41 KB 0.00 KB (0.00%)
basic.ts 7.23 KB 7.23 KB 0.00 KB (0.00%)
batching.ts 11.08 KB 11.08 KB 0.00 KB (0.00%)
brand.ts 6.87 KB 6.87 KB 0.00 KB (0.00%)
cache.ts 11.54 KB 11.54 KB 0.00 KB (0.00%)
config.ts 22.84 KB 22.84 KB 0.00 KB (0.00%)
differ.ts 22.00 KB 22.00 KB 0.00 KB (0.00%)
http-client.ts 27.12 KB 27.12 KB 0.00 KB (0.00%)
http-router.ts 37.04 KB 37.04 KB 0.00 KB (0.00%)
logger.ts 12.01 KB 12.01 KB 0.00 KB (0.00%)
metric.ts 9.47 KB 9.47 KB 0.00 KB (0.00%)
optic.ts 7.10 KB 7.10 KB 0.00 KB (0.00%)
pubsub.ts 16.02 KB 16.02 KB 0.00 KB (0.00%)
queue.ts 12.89 KB 12.89 KB 0.00 KB (0.00%)
schedule.ts 11.80 KB 11.80 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.14 KB 14.14 KB 0.00 KB (0.00%)
schema-binary.ts 41.99 KB 41.99 KB 0.00 KB (0.00%)
schema-class.ts 21.73 KB 21.73 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 29.60 KB 29.60 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 27.99 KB 27.99 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.35 KB 15.35 KB 0.00 KB (0.00%)
schema-string.ts 12.34 KB 12.34 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.27 KB 16.27 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 38.95 KB 38.95 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 26.15 KB 26.15 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 20.90 KB 20.90 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.05 KB 21.05 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.14 KB 21.14 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.17 KB 26.17 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.23 KB 21.23 KB 0.00 KB (0.00%)
schema.ts 20.82 KB 20.82 KB 0.00 KB (0.00%)
stm.ts 14.20 KB 14.20 KB 0.00 KB (0.00%)
stream.ts 10.38 KB 10.38 KB 0.00 KB (0.00%)

@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch from e8ced38 to 4624c32 Compare November 3, 2026 20:26
@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch from fe5ccc1 to 3598aa6 Compare November 3, 2026 21:12
@effect-bot
effect-bot force-pushed the v4/next-minor branch 2 times, most recently from 7cd38d2 to 80d4f51 Compare November 3, 2026 21:25
@tim-smart

Copy link
Copy Markdown
Contributor

/rebase

@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch from 3598aa6 to c4820f4 Compare November 3, 2026 21:35
@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch from c4820f4 to c7132e6 Compare November 3, 2026 22:06
@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch 2 times, most recently from e703a3b to adb761a Compare November 3, 2026 22:29
@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch from adb761a to 0cbe7b4 Compare November 3, 2026 22:43
@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch from 0cbe7b4 to b442493 Compare November 3, 2026 22:50
@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch 2 times, most recently from ad91520 to 915da62 Compare November 3, 2026 23:37
@effect-bot
effect-bot force-pushed the agent/nelson-effect-bot/e71d4993ed70 branch from 915da62 to feed368 Compare November 3, 2026 23:39
Bump @effect/opentelemetry dev dependencies to SDK 3.0.0 / exporters 0.300.0,
replace sdk-trace-base/node/web with @opentelemetry/sdk-trace and drop
@opentelemetry/api-logs. Update tests for the 3.x APIs (SimpleSpanProcessor
options object, AsyncLocalStorageContextManager, SeverityNumber from
@opentelemetry/api), drop advice/type from expected metric descriptors, and
add WebSdk span export coverage.

Source still targets SDK 2.x, so pnpm check and OtelMetrics tests fail
until the implementation lands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support OpenTelemetry JS SDK v3 and replace deprecated tracing peers in Effect v4

2 participants