feat(otel)!: replace EOL Honeycomb SDK with OTel v2 - #7149
Draft
serhalp wants to merge 7 commits into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Contributor
📊 Dependency Size ChangesNote 🎉 This PR removes 15.4 MB of dependencies.
Total size change: -15.4 MB |
@netlify/build
@netlify/build-info
@netlify/cache-utils
@netlify/config
@netlify/edge-bundler
@netlify/functions-utils
@netlify/git-utils
@netlify/headers-parser
@netlify/api
@netlify/nock-udp
@netlify/opentelemetry-sdk-setup
@netlify/opentelemetry-utils
@netlify/redirect-parser
@netlify/run-utils
@netlify/zip-it-and-ship-it
commit: |
`@honeycombio/opentelemetry-node` is archived and EOL'd. Its last release (v0.7.2, Apr 2024) is pinned to OpenTelemetry v1 (`sdk-node@~0.49.1`, `resources@~1.22.0`) and will never support v2, so it blocked the v2 upgrade: passing it a v2 resource crashed `sdk.start()` with `resource.getRawAttributes is not a function`. There are now multiple (user-facing, not dev) CVEs in v1 that we cannot resolve. Honeycomb's own guidance is to migrate to the upstream SDK. We no longer export traces to Honeycomb (they go to an OTLP collector) so the distro's Honeycomb-specific conveniences are no longer needed anyway. Replace it with the equivalent upstream pieces in `opentelemetry-sdk-setup`: - `HoneycombSDK` -> `NodeTracerProvider` + `register()` - bundled OTLP exporter -> `@opentelemetry/exporter-trace-otlp-grpc` - deterministic sampler -> `TraceIdRatioBasedSampler(1 / sampleRate)` - bundled baggage processor -> `@opentelemetry/baggage-span-processor` - `new Resource()` -> `resourceFromAttributes()` The sampler is deliberately *not* wrapped in a `ParentBasedSampler`, despite that being the upstream default. `traceFlags` never reaches the SDK (it is dropped by `bin.ts`, which only parses keys present in `defaultOptions`), so an inherited parent context is always unsampled and a parent-based sampler would silently drop every span. Deciding from the trace ID instead preserves the previous behaviour and still samples consistently across processes in a trace, since the decision is deterministic per trace ID. The baggage span processor is important, not incidental: the root execution attributes (`build.id`, `site.id`, `deploy.id`, ...) are propagated as baggage and only become span attributes because something copies them on span start. Also pin `@opentelemetry/semantic-conventions` to `~1.43.0`. v2 requires `^1.29.0`, so the previous `~1.24.0` pin was unsatisfiable for it and npm installed nine nested copies; they now dedupe to one (18 copies -> 1, and 98 `@opentelemetry` tree entries -> 32). Bump `zip-it-and-ship-it`'s OTEL deps to v2 as well and fix its `function.bundle` span test, which used `BasicTracerProvider#addSpanProcessor()`, removed in v2 in favour of constructor-injected `spanProcessors`. Bump `@opentelemetry/api` from `~1.8.0` to `~1.9.0` everywhere it is declared. This is now required, not cosmetic: the OTLP gRPC exporter reaches `@opentelemetry/sdk-metrics`, which peer-depends on api `>=1.9.0 <1.10.0`, so api 1.8.x resolves as invalid. Widen `@netlify/build`'s optional peer range on `@netlify/opentelemetry-sdk-setup` to admit the new major as well. BREAKING CHANGE: `@netlify/opentelemetry-sdk-setup` no longer accepts a `tracing.apiKey` option, and it is removed from the exported `TracingOptions` type. It only ever set Honeycomb's `x-honeycomb-team` auth header and defaulted to a dummy `'-'` to suppress a warning from that SDK. Traces are exported to the configured OTLP endpoint without it. `@netlify/build` no longer defaults `tracing.apiKey` either. BREAKING CHANGE: `@netlify/build`, `@netlify/opentelemetry-sdk-setup` and `@netlify/opentelemetry-utils` now require `@opentelemetry/api` `~1.9.0` as a peer dependency, up from `~1.8.0`.
serhalp
force-pushed
the
serhalp/fix-upgrade-otel
branch
from
July 31, 2026 18:14
831da7a to
ddd8e0a
Compare
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.
Summary
@honeycombio/opentelemetry-nodeis archived and EOL'd. Its last release (v0.7.2, Apr 2024) is pinned to OpenTelemetry v1 (sdk-node@~0.49.1,resources@~1.22.0) and will never support v2, so it blocked the v2 upgrade: passing it a v2 resource crashedsdk.start()withresource.getRawAttributes is not a function. There are now multiple (user-facing, not dev) CVEs in v1 that we cannot resolve.Honeycomb's own guidance is to migrate to the upstream SDK. We actually no longer export traces to Honeycomb (they go to an OTLP collector) so the distro's Honeycomb-specific conveniences are no longer needed anyway.
Replace it with the equivalent upstream pieces in
opentelemetry-sdk-setup:HoneycombSDK->NodeTracerProvider+register()@opentelemetry/exporter-trace-otlp-grpcTraceIdRatioBasedSampler(1 / sampleRate)@opentelemetry/baggage-span-processornew Resource()->resourceFromAttributes()As a bonus, this also removes 16.9 MB of dependencies and 83 transitive deps (708 → 625). However, the direct user-facing impact on netlify-cli is 4 MB and 0 deps.
The sampler is deliberately not wrapped in a
ParentBasedSampler, despite that being the upstream default.traceFlagsnever reaches the SDK (it is dropped bybin.ts, which only parses keys present indefaultOptions), so an inherited parent context is always unsampled and a parent-based sampler would silently drop every span. Deciding from the trace ID instead preserves the previous behaviour and still samples consistently across processes in a trace, since the decision is deterministic per trace ID.The baggage span processor is important, not incidental: the root execution attributes (
build.id,site.id,deploy.id, ...) are propagated as baggage and only become span attributes because something copies them on span start.Also pin
@opentelemetry/semantic-conventionsto~1.43.0. v2 requires^1.29.0, so the previous~1.24.0pin was unsatisfiable for it and npm installed nine nested copies; they now dedupe to one (18 copies -> 1, and 98@opentelemetrytree entries -> 32).Bump
zip-it-and-ship-it's OTEL deps to v2 as well and fix itsfunction.bundlespan test, which usedBasicTracerProvider#addSpanProcessor(), removed in v2 in favour of constructor-injectedspanProcessors.Bump
@opentelemetry/apifrom~1.8.0to~1.9.0everywhere it is declared. This is now required, not cosmetic: the OTLP gRPC exporter reaches@opentelemetry/sdk-metrics, which peer-depends on api>=1.9.0 <1.10.0, so api 1.8.x resolves as invalid. Widen@netlify/build's optional peer range on@netlify/opentelemetry-sdk-setupto admit the newmajor as well.
BREAKING CHANGE:
@netlify/opentelemetry-sdk-setupno longer accepts atracing.apiKeyoption, and it is removed from the exportedTracingOptionstype. It only ever set Honeycomb'sx-honeycomb-teamauth header and defaulted to a dummy'-'to suppress a warning from that SDK. Traces are exported to the configured OTLP endpoint without it.@netlify/buildno longer defaultstracing.apiKeyeither.BREAKING CHANGE:
@netlify/build,@netlify/opentelemetry-sdk-setupand@netlify/opentelemetry-utilsnow require@opentelemetry/api~1.9.0as a peer dependency, up from~1.8.0.