Skip to content

fix: align @opentelemetry direct deps with @sentry major to fix npm ci - #3898

Closed
tlowrimore-heroku wants to merge 1 commit into
mainfrom
fix/align-opentelemetry-major-with-sentry
Closed

fix: align @opentelemetry direct deps with @sentry major to fix npm ci#3898
tlowrimore-heroku wants to merge 1 commit into
mainfrom
fix/align-opentelemetry-major-with-sentry

Conversation

@tlowrimore-heroku

@tlowrimore-heroku tlowrimore-heroku commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Open Dependabot npm PRs are failing CI. Every job stops within seconds with:

npm error `npm ci` can only install packages when your package.json and package-lock.json ... are in sync.
npm error Missing: @opentelemetry/exporter-trace-otlp-http@0.222.0 from lock file

main is fine — only the Dependabot branches fail.

Why it happens

The CLI pins the @opentelemetry/* packages to an old version, but @sentry/node needs a newer version of those same packages. Since both versions have to exist at once, npm keeps a second copy of the OpenTelemetry packages tucked inside node_modules/@sentry/node. When Dependabot rebuilds the lock file for one of its bumps, it drops that nested copy. The lock file then no longer matches package.json, and npm ci refuses to run.

The fix

Move the CLI's @opentelemetry/* pins up to the same major version @sentry/node already uses. With one shared version there is only a single copy of each package, so there is nothing left for Dependabot to drop — the two files stay in sync on future PRs.

Bumping the packages required a small code update in backboard-otel-client.ts, because the OpenTelemetry v2 API removed the pieces the old code used:

  • Resource / Resource.default()resourceFromAttributes() / defaultResource()
  • SemanticResourceAttributesATTR_SERVICE_NAME / ATTR_SERVICE_VERSION
  • provider.addSpanProcessor() → span processors are now passed into the NodeTracerProvider constructor
  • Switched to SimpleSpanProcessor, which sends each span as it ends — a better fit for a CLI that emits one span per run and then exits

Versions are pinned to the older, proven line (2.10.0 / 0.221.0 / 0.214.0, published in July) rather than the newest release, to stay inside the package-aging window CI enforces.

Once this merges, the stuck Dependabot PRs (#3872, #3873, #3874, #3875, #3895, #3896) should pass after a rebase.

Type of Change

Breaking Changes (major semver update)

  • Add a ! after your change type to denote a change that breaks current behavior

Feature Additions (minor semver update)

  • feat: Introduces a new feature to the codebase

Patch Updates (patch semver update)

  • fix: Bug fix
  • deps: Dependency upgrade
  • revert: Revert a previous commit
  • chore: Change that does not affect production code
  • refactor: Refactoring existing code without changing behavior
  • test: Add/update/remove tests

Testing

Notes:
No config or setup needed. The change is verified by a clean install plus the existing test suite. The telemetry send path was also checked by hand against a mocked OTLP endpoint to confirm spans are still delivered.

Steps:

  1. npm ci — installs cleanly and reports the lock file is in sync (previously failed on the Dependabot branches).
  2. npm run build — passes.
  3. npm run lint — passes.
  4. Full unit suite — 2340 passing.
  5. Confirmed the nested @sentry/node/node_modules/@opentelemetry copy is gone and OpenTelemetry now resolves to a single shared version.

Screenshots (if applicable)

N/A

Related Issues

GitHub issue: N/A
GUS work item: N/A

The CLI pinned @opentelemetry/* to the old major (exporter 0.52.x, stable
1.25.x) while @sentry/node@10 / @sentry/opentelemetry@10 require the new
major (core/sdk-trace-base ^2.6.1, instrumentation ^0.214.0). Because two
incompatible otel majors had to coexist, npm nested Sentry's copies under
node_modules/@sentry/node/node_modules/@opentelemetry/*.

Dependabot's lock regeneration dropped that nested subtree, producing a
package-lock.json that no longer satisfied package.json. Every dependabot
npm PR then failed `npm ci` with "Missing: @opentelemetry/...@0.222.0 from
lock file" (PRs #3872, #3873, #3874, #3875, #3895, #3896).

Bump the direct otel pins to the same major Sentry uses so the tree hoists
to a single copy with nothing fragile to nest and prune. Versions are held
to the aged 2.10.0 / 0.221.0 / 0.214.0 line (published 2026-07-21) to stay
inside the package-aging window.

Migrate backboard-otel-client.ts to the SDK v2 API:
- Resource: defaultResource()/resourceFromAttributes() replace the removed
  Resource class and Resource.default().
- semantic-conventions: ATTR_SERVICE_NAME/ATTR_SERVICE_VERSION replace the
  removed SemanticResourceAttributes.
- NodeTracerProvider: span processors are passed via the constructor
  (spanProcessors) since addSpanProcessor was removed.
- Use SimpleSpanProcessor: the CLI emits one span per run and flushes before
  exit, so exporting on span end is a better fit than batching.
@tlowrimore-heroku

Copy link
Copy Markdown
Contributor Author

Fixes out-of-sync issues between package.json and package-lock.json, but this would necessitate either a major version release of CLI, or us breaking our semver rules. Opting to explore other options. Closing.

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