chore: import instrumentation module in api container entrypoint#1167
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe API container startup command is updated to load an instrumentation module at Node process startup using the ChangesAPI Instrumentation Startup
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the API container entrypoint to preload the OpenTelemetry instrumentation module at startup, aligning the Docker runtime behavior with the app’s existing start script.
Changes:
- Modify the API Docker image
CMDto run Node with--import ./instrumentation.jsbeforeindex.js.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| WORKDIR /app/apps/api/dist/src/ | ||
|
|
||
| CMD ["node", "index.js"] | ||
| CMD ["node", "--import", "./instrumentation.js", "index.js"] |
The API is instrumented with OpenTelemetry but none of its telemetry reaches Datadog, because the SDK only initializes via Node's --import flag and the Dockerfile runs node index.js without it (only the npm scripts pass it), so sdk.start() never runs in prod. Adding the flag to the CMD fixes it — the collector→Datadog path already works, so once this ships the API will start reporting traces/metrics/logs and we can finally monitor it.