Repository navigation
feat(telemetry): project query-unit evidence to OTel (#2183) - #2215
Conversation
Problem: Polylogue had an inbound OTLP receiver but no outbound projection from its own archive evidence into an observability-shaped payload. Issue #2183 calls for bounded OTel-style export that keeps Polylogue refs canonical and does not leak raw tool output or local paths by default.\n\nWhat changed: added typed OTel projection payloads, a pure telemetry projection module over query-unit rows, and a Polylogue.export_otel API method that projects bounded query-unit expressions. The projection maps runs/actions to spans, observed events/context snapshots/messages to log records, preserves refs, redacts local paths and tool output, and documents the inbound-vs-outbound telemetry split.\n\nVerification: devtools test tests/unit/telemetry/test_otel_projection.py tests/unit/api/test_facade_contracts.py::test_export_otel_projects_query_unit_rows -q; devtools test tests/unit/cli/test_plain_cli_snapshots.py::test_json_status_snapshot -q; devtools verify --seed-testmon --skip-slow; devtools verify.\n\nRef #2183
|
Warning Review limit reached
More reviews will be available in 15 minutes and 30 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa62087343
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _set_optional(attributes, "polylogue.action.tool_result_block_id", row.tool_result_block_id) | ||
| _set_optional(attributes, "polylogue.action.tool_name", row.tool_name) | ||
| _set_optional(attributes, "polylogue.action.semantic_type", row.semantic_type) | ||
| _set_optional(attributes, "polylogue.action.tool_command", row.tool_command) |
There was a problem hiding this comment.
Redact absolute paths embedded in tool commands
When an action row comes from a shell command such as cat /home/alice/secret.txt or pytest /workspace/polylogue/tests, this line copies the full command into the outbound OTel attributes even though the projector’s contract says absolute local paths are omitted. The separate tool_path redaction does not cover paths embedded in tool_command, so the new export can leak local filesystem layout by default.
Useful? React with 👍 / 👎.
Problem: automated review correctly found that outbound OTel projection could still leak absolute paths through tool_path values outside the small prefix allowlist and through absolute paths embedded inside tool_command. That violated the projection's documented default privacy posture.\n\nWhat changed: treat every absolute POSIX tool_path as redacted, suppress tool_command when it contains an absolute path token, and add regression coverage for /home, /tmp, /workspace, and /mnt/data examples.\n\nVerification: devtools test tests/unit/telemetry/test_otel_projection.py tests/unit/api/test_facade_contracts.py::test_export_otel_projects_query_unit_rows -q; devtools verify --quick.\n\nRef #2183
|
Addressed the two Codex privacy findings in 0d1b0ed. The projector now redacts every absolute POSIX tool_path, suppresses tool_command when it embeds an absolute path token, and has regression coverage for /home, /tmp, /workspace, and /mnt/data examples. Focused telemetry/API tests and devtools verify --quick passed after the fix. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds Polylogue's outbound OTel-style projection surface: query-unit evidence can now be projected into a bounded JSON payload with spans for runs/tool actions and log records for messages, observed events, and context snapshots.
Closes #2183.
Problem
Polylogue already had an inbound OTLP receiver for external telemetry, but no outbound view that let standard observability tooling inspect Polylogue's own AI-work evidence. The missing piece was a projection that preserves Polylogue refs as canonical archive navigation, keeps trace/span ids as export identifiers only, and avoids leaking raw tool output or local paths by default.
Solution
OtelProjectionPayload,OtelSpanPayload, andOtelLogRecordPayloadinpolylogue/surfaces/payloads.py.polylogue.telemetry.otel_projection.project_query_unit_rows_to_otel, a pure projector over existing query-unit row payloads.Polylogue.export_otel(...), which evaluates bounded query-unit expressions and returns the projection payload.docs/search.md.The projection maps runs/actions to spans, observed events/context snapshots/messages to log records, carries refs in payload refs/links, redacts local paths, and records tool output presence/length instead of copying output text.
Verification
devtools test tests/unit/telemetry/test_otel_projection.py tests/unit/api/test_facade_contracts.py::test_export_otel_projects_query_unit_rows -q-> 3 passed.devtools test tests/unit/cli/test_plain_cli_snapshots.py::test_json_status_snapshot --snapshot-update -q-> 1 snapshot updated.devtools test tests/unit/cli/test_plain_cli_snapshots.py::test_json_status_snapshot -q-> 1 passed, 1 snapshot passed.devtools verify --seed-testmon --skip-slow-> 11651 passed, 9 warnings in 286.25s; peak pytest tree RSS 3207.0 MiB.devtools verify-> 7 passed in 18.30s, total gate exit 0.devtools verify --quick-> exit 0.