Skip to content

chore(api): Export OTEL logs for api#1114

Open
jsingleton-dev wants to merge 1 commit intomainfrom
jsingleton/api-otel-logs
Open

chore(api): Export OTEL logs for api#1114
jsingleton-dev wants to merge 1 commit intomainfrom
jsingleton/api-otel-logs

Conversation

@jsingleton-dev
Copy link
Copy Markdown
Collaborator

@jsingleton-dev jsingleton-dev commented May 7, 2026

This PR adds the OTEL exporter for the api application. This will let us see API logs in datadog.

Summary by CodeRabbit

  • Chores
    • Updated observability and logging infrastructure with enhanced system monitoring capabilities.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 24b9ea11-c5eb-495e-8dba-eed5193d6d60

📥 Commits

Reviewing files that changed from the base of the PR and between 73e359a and 352875a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • apps/api/package.json
  • apps/api/src/instrumentation.ts

📝 Walkthrough

Walkthrough

The pull request adds OpenTelemetry logs support to the API by introducing the @opentelemetry/sdk-logs dependency and configuring log record batching and OTLP export within the Node SDK instrumentation setup.

Changes

OpenTelemetry Logs Support

Layer / File(s) Summary
Dependencies
apps/api/package.json
@opentelemetry/sdk-logs (^0.217.0) is added to dependencies alongside existing OpenTelemetry packages.
Log Exporter Configuration
apps/api/src/instrumentation.ts
OTLPLogExporter and BatchLogRecordProcessor are imported and configured in the NodeSDK logRecordProcessors field to batch and export logs over OTLP HTTP.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • ctrlplanedev/ctrlplane#1110: Related OpenTelemetry initialization in apps/api/src/instrumentation.ts — that PR adds OTLP tracing/metrics setup while this PR extends the NodeSDK config to add OTLP log exporting.

Suggested reviewers

  • adityachoudhari26

Poem

🐰 Hop hop, logs now flow,
Through batches, OTLP they go,
Telemetry grows with each new hop,
OpenTelemetry will not stop!
Observability, we're not alone,
The logs have finally found their home. 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(api): Export OTEL logs for api' clearly and concisely summarizes the main change: adding OpenTelemetry log exporting to the API application.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jsingleton/api-otel-logs

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