Skip to content

Observability for the key-minting and docs surface: spans, PII boundary, audit coverage #869

Done

Description

@athvin

API product implementation work · roadmap #1008 · use parent dependency order; not a separate product rank.

Part of #857. Stack rank 12 of 13. Depends on: T9, T10 (instruments their surfaces).

Color

Two obligations from the observability skill: new and changed handlers carry spans, and the PII boundary holds. The minted key plaintext and the webhook secret are exactly the kind of value the collector's PII allowlist exists to drop (see the allowlist regression test added in bc6f6163) — and the key-issue path is a new place where a secret passes through handler code with a span open.

Scope

  • Instrument T9's new/changed handlers per er-span conventions (the generated query functions already carry SQL spans; the handler-level span is the addition).
  • BFF docs route + api-keys routes: telemetry per the existing BFF conventions (trace context forwarding is already in proxy.ts).
  • Assertion that key-issue spans/logs carry key_id and role but never the plaintext or the hash — grep-level test plus the collector-allowlist pattern.
  • Audit-row coverage asserted in tests (issue + revoke; already written by the handlers — verify, don't rebuild).
  • Decide (and record): does the public docs endpoint get a counter? Default no — a page view is not an engine metric, and the metric registry's forbidden-dimension list is a cost control; add only if there's a question it answers.

Out of scope

New metrics for the spec endpoints beyond the decision above; dashboard work.

Testing

  • Telemetry gates green (make check includes them).
  • A deliberate span.record("key", plaintext) fixture is caught by the PII gate — observed failing, then removed.
  • Trace continuation: a key-mint request's audit row and span share the request's trace context (the existing telemetry_trace_continuation.rs pattern).

Definition of done

Epic DoD, plus: new handlers instrumented; the plaintext-never-on-a-span assertion exists and was seen failing; audit coverage asserted.

Activity

  1. added
    rust
    javascript
    mvp
    on Nov 8, 2026
  2. self-assigned this
    on Nov 25, 2026
  3. athvin commented on Nov 25, 2026

    @athvin
    OwnerAuthor

    Claimed — working in #1227 (draft). Closing that PR releases the claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

javascriptmvprust

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions