Skip to content

feat: add structured OTel request logs with source IP#117

Merged
rsbh merged 2 commits into
mainfrom
feat/otel-request-logs
Jun 3, 2026
Merged

feat: add structured OTel request logs with source IP#117
rsbh merged 2 commits into
mainfrom
feat/otel-request-logs

Conversation

@rsbh
Copy link
Copy Markdown
Member

@rsbh rsbh commented Jun 3, 2026

Summary

  • Adds OpenTelemetry structured logs to the telemetry plugin (ConsoleLogRecordExporter → stdout)
  • Each HTTP request emits a log record with client.address (extracted from x-forwarded-forx-real-ipremoteAddress), method, route, status code, and duration
  • New deps: @opentelemetry/sdk-logs, @opentelemetry/api-logs

Test plan

  • Dev server starts without errors when telemetry enabled
  • Structured log records emitted for all endpoints (/, /api/health, /api/search, /sitemap.xml, /robots.txt)
  • Log attributes include client.address, http.request.method, url.path, http.response.status_code, http.request.duration_ms
  • Verify IP populated correctly behind reverse proxy (x-forwarded-for)

🤖 Generated with Claude Code

Adds OpenTelemetry SDK logs to the telemetry plugin, emitting structured
log records to stdout for every HTTP request. Each log includes
client.address (from x-forwarded-for/x-real-ip/remoteAddress), method,
route, status code, and duration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chronicle Ready Ready Preview, Comment Jun 3, 2026 6:41am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Warning

Review limit reached

@rsbh, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 57 minutes and 3 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a66c3011-9136-419c-a7c4-6e4295951efe

📥 Commits

Reviewing files that changed from the base of the PR and between 06013f3 and 5d1628b.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • packages/chronicle/package.json
  • packages/chronicle/src/server/plugins/telemetry.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/otel-request-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.

Copy link
Copy Markdown
Member

@rohilsurana rohilsurana left a comment

Choose a reason for hiding this comment

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

LGTM

@rsbh rsbh merged commit 86cbba0 into main Jun 3, 2026
7 of 8 checks passed
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.

2 participants