Skip to content

fix: Add instrumentation to docker start cmd#1168

Closed
jsingleton-dev wants to merge 1 commit into
mainfrom
jsingleton/api-instrument-fix
Closed

fix: Add instrumentation to docker start cmd#1168
jsingleton-dev wants to merge 1 commit into
mainfrom
jsingleton/api-instrument-fix

Conversation

@jsingleton-dev

@jsingleton-dev jsingleton-dev commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

I forgot to add this in my previous PR. This should load the instrumentation setup to get OTEL metrics and logs exported

Summary by CodeRabbit

  • Chores
    • Updated container initialization configuration for the API service to enhance application startup handling.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dbe19e35-9f49-4920-82e0-56672c259992

📥 Commits

Reviewing files that changed from the base of the PR and between 04d5cdd and e1afb6c.

📒 Files selected for processing (1)
  • apps/api/Dockerfile

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

The API container startup command is updated to load the instrumentation module before the main application runs, switching from direct node execution to using Node's --import flag to preload ./instrumentation.js ahead of index.js.

Changes

API Instrumentation Preload

Layer / File(s) Summary
API startup with instrumentation preload
apps/api/Dockerfile
Node.js container CMD changes from node index.js to node --import ./instrumentation.js index.js, ensuring the instrumentation module loads before the API server executes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • ctrlplanedev/ctrlplane#1114: Adds instrumentation.ts to configure OpenTelemetry log exporting, which this Dockerfile change now ensures is loaded at API runtime.
  • ctrlplanedev/ctrlplane#1110: Introduces OpenTelemetry instrumentation for the API runtime, which this Dockerfile now wires into the Node startup sequence.
  • ctrlplanedev/ctrlplane#483: Updates another container (event-worker) to preload instrumentation at startup, following a similar pattern for instrumentation wiring.

Suggested reviewers

  • adityachoudhari26
  • mleonidas

Poem

🐰 A dockerfile tweak, oh what delight!
With --import flag, instrumentation shines bright,
Before the API runs its course,
Observability flows with force!
Telemetry whispers through the night.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jsingleton/api-instrument-fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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