Repository navigation
feat(cloud): archive read-back, error→trace links, gen-redaction, capability test - #163
Conversation
…ction Addresses the top monitoring gaps: - **R2-SQL read-back (item 1).** `TelemetryStore.readArchivedTrace` reads a trace's spans from the columnar archive (Iceberg) via R2 SQL, with a pure, tested row→observation mapper — the read symmetric to `archiveSpans`. Gated on R2_SQL_TOKEN (no-op [] until a cell provisions it); the reachable route + UI fallback are the remaining 🌐 sliver. - **Error → trace linking (item 2).** Error spans now carry their `traceId` into the fingerprinted Issue (`issues.sampleTraceId`), and the dashboard gained cross-tab deep-links: Issue → its trace, trace → its logs, and a log line → its trace (with keyboard-safe buttons). - **Generation-text redaction (item 6).** `redactText` scrubs secret-shaped substrings (bearer tokens, api keys, JWTs, `secret=…`) from a recorded prompt/completion, where key-based redaction can't reach. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197KjhmBDB3PXAc6TXiPqZ9
- **Auth-fix coverage (item 4).** Extract the scoped-key decision into a pure `isDeployCapable(row)` that both the deploy entrypoint (`deploy_keys.verify`) and the per-mutation gate (`authorizeDeployKey`) call — so an ingest key can never disagree between them — and unit-test it (the cloud has no DB harness, so this covers the decision that was the dead-on-arrival bug). - **Redact regex cleanup.** `redact`'s key/text patterns rewritten to `String.raw` + `\w`/`\d`, drop a duplicate `secret` disjunction, and use `replaceAll` (verified with eslint via alpha's TS-6 pin, run locally). Note: eslint can't run on this branch (sonarjs vs TS 7) until the Phase-0 rebase onto alpha; running it locally under the pin also surfaced a pre-existing cloud lint backlog (cognitive-complexity on the big decoders), which predates this PR and belongs to that rebase, not the OTLP feature. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197KjhmBDB3PXAc6TXiPqZ9
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
Thank you for following the naming conventions! 🙏 |
|
Thank you for confirming the Contributor License Agreement! 🙏 |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Cross-tab deep-links were the one MEDIUM: the target section synced `focusTraceId` in a `useEffect`, so a stale trace re-applied on unrelated re-renders and deep-linking the same trace twice never re-fired. Replace with a seq-keyed one-shot — the dashboard bumps a focus `seq` on every navigation and remounts the target via `key`, so each section seeds `focusTraceId` in its state initializer (effects removed from Traces/Logs). Code-quality findings: - archive-read: `compact()` helper so each cell coercion runs once instead of the double-evaluated conditional spreads. - Extract the shared `CrossTabLink` component + collapse the near-duplicate `.trace-link`/`.log-trace-link` CSS into `.cross-tab-link`. - redactText: named capture groups (`bearer`/`kv`) over positional, robust to alternative reordering. - store.readArchivedTrace: validate the env-configured span table with `tableRef(...)` before `raw` splices it (re-exported from @lunora/bindings/r2sql). Refresh the stale `_generated/shard.ts` advisory line numbers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197KjhmBDB3PXAc6TXiPqZ9
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Follow-up to the merged #161 (full OTel integration), completing items 1, 2, 6, 4 from the "do 1 to 10" gap-closure:
TelemetryStore.readArchivedTracereads a trace's spans from the columnar archive (Iceberg) via R2 SQL, with a pure, tested row→observation mapper — the read symmetric toarchiveSpans. Gated onR2_SQL_TOKEN(no-op[]until a cell provisions it).traceIdinto the Issue (issues.sampleTraceId); the dashboard gained cross-tab deep-links (Issue → trace, trace → logs, log → trace), keyboard-safe.redactTextscrubs secret-shaped substrings from a recorded prompt/completion.isDeployCapableshared by the deploy entrypoint + the per-mutation gate.Not included (🌐): the read-back's UI wiring +
R2_SQL_TOKENprovisioning, a metrics dashboard (AE, SQL-only), a live E2E run; eslint needs the Phase-0 rebase (which also clears a pre-existing cloud lint backlog).Test plan
325 cloud tests pass,
tscclean.🤖 Generated with Claude Code