Skip to content

Conversation

@rochdev
Copy link
Member

@rochdev rochdev commented Feb 3, 2026

What does this PR do?

Add explicit dependency on OpenTelemetry API.

Motivation

The dependency is now optional in dd-trace because it's only needed when used. However, this means that when the dependency is present but bundled, dd-trace is unable to access it. This is only a problem in serverless because it's the only environment where dd-trace is installed outside of the project root and optional dependencies are skipped at the same time. In theory this would be a problem in any case since it results in multiple versions being installed, but for OTel specifically it works because it uses globals to share state between versions.

Testing Guidelines

Additional Notes

The right approach would be to have a separate Datadog scoped package that we would recommend using instead of bundling the OpenTelemetry provider with dd-trace. I added a TODO to this effect.

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@rochdev rochdev marked this pull request as ready for review February 3, 2026 02:59
@rochdev rochdev requested review from a team as code owners February 3, 2026 02:59
@rochdev rochdev merged commit d7a4a40 into main Feb 3, 2026
33 checks passed
@rochdev rochdev deleted the fix-missing-otel-api branch February 3, 2026 19:29
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.

3 participants