Skip to content

[NodeJS] Update fastify endpoint to use dd-trace's custom OTel context manager#6223

Open
ida613 wants to merge 1 commit intomainfrom
ida613/otel-baggage-api-fix
Open

[NodeJS] Update fastify endpoint to use dd-trace's custom OTel context manager#6223
ida613 wants to merge 1 commit intomainfrom
ida613/otel-baggage-api-fix

Conversation

@ida613
Copy link
Contributor

@ida613 ida613 commented Feb 5, 2026

Update the fastify end point otel_drop_in_baggage_api_otel to use dd-trace-js's custom OTel context manager. Before this change, OpenTelemetry api calls in this end point do not go through any of the otel drop in support code within dd-trace-js.

Changes

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

CODEOWNERS have been resolved as:

utils/build/docker/nodejs/fastify/app.js                                @DataDog/dd-trace-js @DataDog/system-tests-core

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 5, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 1 New flaky test detected

tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin.test_inproduct_enablement_code_origin[fastify] from system_tests_suite (Datadog) (Fix with Cursor)
AssertionError: Expected code origin enabled by default
assert False
 +  where False = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin object at 0x7f92e4555310>.co_initial_state

self = <tests.debugger.test_debugger_inproduct_enablement.Test_Debugger_InProduct_Enablement_Code_Origin object at 0x7f92e4555310>

    def test_inproduct_enablement_code_origin(self):
        self.assert_rc_state_not_error()
        self.assert_all_weblog_responses_ok()
    
...

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 25c3339 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@ida613 ida613 marked this pull request as ready for review February 6, 2026 19:09
@ida613 ida613 requested review from a team as code owners February 6, 2026 19:09
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25c33399d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 611 to +612
const api = require('@opentelemetry/api')
const ContextManager = require('dd-trace/packages/dd-trace/src/opentelemetry/context_manager')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a dd-trace path that exists in npm installs

This endpoint now requires dd-trace/packages/dd-trace/src/opentelemetry/context_manager, but in the default Docker build dd-trace is installed from npm (see utils/build/docker/nodejs/install_ddtrace.sh). The published package doesn’t include the monorepo path packages/dd-trace/..., so require will throw MODULE_NOT_FOUND and the endpoint will 500 in the common npm-install case. This only works when the monorepo layout is present (e.g., a local repo build), so the endpoint becomes broken for standard installs.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do i fix it?

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