Skip to content

feat(cloud): archive read-back, error→trace links, gen-redaction, capability test - #163

Merged
prisis merged 3 commits into
feat/cloud-traces-viewerfrom
feat/cloud-otlp-followups
Jul 22, 2026
Merged

prisis merged 3 commits into
feat/cloud-traces-viewerfrom
feat/cloud-otlp-followups

Conversation

@prisis

@prisis prisis commented Jul 22, 2026

Copy link
Copy Markdown
Member

Follow-up to the merged #161 (full OTel integration), completing items 1, 2, 6, 4 from the "do 1 to 10" gap-closure:

  • R2-SQL span 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).
  • Error → trace linking (item 2) — error spans carry traceId into the Issue (issues.sampleTraceId); the dashboard gained cross-tab deep-links (Issue → trace, trace → logs, log → trace), keyboard-safe.
  • Generation-text redaction (item 6) — redactText scrubs secret-shaped substrings from a recorded prompt/completion.
  • Auth-fix coverage (item 4) — the scoped-key decision extracted to a pure, unit-tested isDeployCapable shared by the deploy entrypoint + the per-mutation gate.

Not included (🌐): the read-back's UI wiring + R2_SQL_TOKEN provisioning, 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, tsc clean.

🤖 Generated with Claude Code

prisis and others added 2 commits July 22, 2026 08:06
…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
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • alpha

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2457cad5-2d3b-4baa-87a4-2cc784af8443

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cloud-otlp-followups

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.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for confirming the Contributor License Agreement! 🙏

@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit d09a57a.

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
@prisis
prisis merged commit 57c5ffa into feat/cloud-traces-viewer Jul 22, 2026
6 checks passed
@prisis
prisis deleted the feat/cloud-otlp-followups branch July 22, 2026 07:04
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant