chore(dev): just recipes to dogfood OTLP telemetry into a local server - #605
Conversation
Adds `just dogfood-server`, `just dogfood-env`, and `just dogfood-clean` so a developer can capture real agent telemetry locally without installing anything — Ourios *is* an OTLP log receiver, so no Collector or container is needed. `dogfood-server` runs ourios-server with the receiver + querier roles and a local filesystem store/WAL under scratch/dogfood/ (gitignored); the receiver is open (no auth section → open, RFC 0026) and listens on 4318 (OTLP/HTTP), 4317 (gRPC), 4319 (query). `dogfood-env` prints the source-side env block to point a tool's telemetry (Claude Code, Copilot CLI, an OTel Collector) at it — logs-only per §1, with content capture called out as opt-in/privacy-sensitive. Verified end-to-end: the server boots on the recipe's env, a claude_code-shaped OTLP log POSTed to :4318/v1/logs returns HTTP 200 and is durably ingested (WAL segment written). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe ChangesLocal OTLP log dogfood workflow
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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
Adds developer-ergonomics just recipes to make it easy to run a local Ourios instance as an OTLP logs sink and point real tool telemetry (e.g., Claude Code / Copilot CLI / Collector) at it, storing everything under scratch/ for local dogfooding.
Changes:
- Add
just dogfood-serverto runourios-serverlocally with receiver + querier enabled and local store/WAL underscratch/dogfood/. - Add
just dogfood-envto print an environment-variable block for exporting OTLP logs to the local receiver (metrics/traces disabled). - Add
just dogfood-cleanto wipe the local dogfood data directory.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@justfile`:
- Around line 233-235: Update dogfood-server to create and maintain a lock or
PID marker while running, then make dogfood-clean check that marker before
executing rm -rf and refuse cleanup when the server is active. Ensure the marker
is reliably removed when dogfood-server exits so cleanup can proceed afterward.
- Around line 214-225: Update the dogfood-env telemetry block to remove any
hard-coded Claude-specific service identity from the shared OpenTelemetry
environment, using a configurable or source-neutral service name instead. Keep
Claude-specific telemetry flags separate from generic OTel exports, preserving
the existing logs-only settings.
- Around line 204-211: Update the dogfood-server environment setup before cargo
run to explicitly bind receiver and querier endpoints to loopback, including the
receiver ports, querier HTTP port, and OTEL_EXPORTER_OTLP_ENDPOINT. Keep the
printed localhost URLs and existing storage and role settings unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
…, clean guard Review fixes (Copilot + CodeRabbit): - Bind the receiver + querier to 127.0.0.1 (OURIOS_RECEIVER_GRPC_ADDR/HTTP_ADDR, OURIOS_QUERIER_HTTP_ADDR), not ourios-server's 0.0.0.0 defaults. The receiver is unauthenticated for local dogfooding, so binding to all interfaces would expose open OTLP ingest + a query API to the LAN (e.g. on public Wi-Fi); loopback keeps it to this machine. - dogfood-env no longer hard-codes Claude identity: the OTEL_* block is source-agnostic and the tool-specific *enable* flag (CLAUDE_CODE_ENABLE_ TELEMETRY vs COPILOT_OTEL_ENABLED) is a per-tool comment, so the same block serves Claude Code, Copilot CLI, or any OTLP source. OTEL_SERVICE_NAME is a placeholder (the source's identity -> the Ourios tenant). - dogfood-clean refuses to rm -rf while dogfood-server is still listening on 4318, so cleanup can't race the server mid-write and corrupt the capture. A port-in-use check rather than a PID/lock file: it directly answers "is the server writing?" and can't go stale on an abnormal exit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
A failed `if` condition is not caught by `set -e`, so a missing lsof would silently skip the running-server guard and let the wipe race a live server. Fail hard instead, and match the message to what the check actually observes (port in use). Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
The query API requires the x-ourios-tenant header (RFC 0016 §3.3), derived from service.name — a first query without it 400s. Print a copy-paste curl using the same tenant as OTEL_SERVICE_NAME. Convert the recipe to a quoted heredoc so the single-quoted curl needs no escaping. Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
justrecipes to dogfood OTLP telemetry into a local OuriosDev-ergonomics only (no product code) — makes it a one-liner to capture real agent telemetry locally, per the discussion about using Claude Code / Copilot CLI OTLP output as a real (non-synthetic) corpus. The key insight: Ourios is an OTLP log receiver, so there's nothing to install — no Collector, no container runtime.
Three recipes:
just dogfood-server— runsourios-serverwith the receiver + querier roles and a local filesystem store/WAL underscratch/dogfood/(gitignored). Open receiver (no auth section → open, RFC 0026); ports 4318 (OTLP/HTTP), 4317 (gRPC), 4319 (query).just dogfood-env— prints the source-side env block to point a tool's telemetry at it (Claude Code, Copilot CLI, or any OTel Collector). Logs-only per §1 (metrics/traces disabled); content capture is called out as opt-in and privacy-sensitive (that's where the wordy structured bodies live — scrub before freezing any of it as a corpus).just dogfood-clean— wipes the captured store.Why it's safe / in scope
Justfile— no product code, no new dependencies.scratch/(gitignored); nothing persistent is committed.just --listrenders them like the other multi-line recipes.Verified end-to-end (not just plausible)
Booted the server on the recipe's exact env, POSTed a
claude_code.user_prompt-shaped OTLP log to:4318/v1/logs→ HTTP 200 (partialSuccess: null), durably ingested (WAL segment written), clean shutdown.Usage:
just dogfood-serverin one terminal,just dogfood-envin another (exportthe output, then start a newclaudesession so telemetry is picked up at startup).🤖 Generated with Claude Code
Summary by CodeRabbit