[NodeJS] Update fastify endpoint to use dd-trace's custom OTel context manager#6223
[NodeJS] Update fastify endpoint to use dd-trace's custom OTel context manager#6223
Conversation
|
|
|
There was a problem hiding this comment.
💡 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".
| const api = require('@opentelemetry/api') | ||
| const ContextManager = require('dd-trace/packages/dd-trace/src/opentelemetry/context_manager') |
There was a problem hiding this comment.
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 👍 / 👎.
Update the fastify end point
otel_drop_in_baggage_api_otelto 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
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present