Skip to content

Scope HAE ingestion metrics per-user; show data coverage to all roles#218

Merged
d3mocide merged 1 commit into
mainfrom
claude/trusting-ritchie-5ijuzt
Jun 16, 2026
Merged

Scope HAE ingestion metrics per-user; show data coverage to all roles#218
d3mocide merged 1 commit into
mainfrom
claude/trusting-ritchie-5ijuzt

Conversation

@d3mocide

Copy link
Copy Markdown
Owner

$(cat <<'EOF'

Summary

  • Bug fix: HAE ingestion metrics (Ingestions, Rows in, Errors, Last success, Recent Ingestions) were stored in global Redis keys (luma:hae_metrics:totals), so every user saw the same system-wide counts. Keys are now scoped per-user: luma:hae_metrics:{user_id}:totals/events/meta.
  • record_ingest() and snapshot() in hae_metrics.py now both require a user_id parameter. All six call sites in ingest.py pass user_id=user.id.
  • Data coverage card (HaeDiagnosticCard) is no longer gated behind isOperator in the frontend — the backend already filters stored_metrics by user.id, so all users can see their own coverage. The payload analyzer (HaeAnalyzeCard) remains operator-only.

Test plan

  • Log in as User A and ingest some HAE data → HAE Ingestion card shows counts for User A only
  • Log in as User B (fresh account) → HAE Ingestion card shows 0 / empty, not User A's numbers
  • Non-operator user sees the Data Coverage section (stored metrics table) on the Data Sources settings tab
  • Non-operator user does NOT see the Payload Analyzer card
  • Operator user still sees both Data Coverage and Payload Analyzer

https://claude.ai/code/session_01EB8QMvqDxdSw3FT4sfNht2
EOF
)


Generated by Claude Code

Redis keys for HAE metrics were global (luma:hae_metrics:totals), so every
user saw the same system-wide ingestion counts. Thread user_id through
record_ingest() and snapshot() so keys are scoped to luma:hae_metrics:{uid}:*.

Also removes the operator gate on HaeDiagnosticCard — the backend already
filters stored_metrics by user.id, so all users can now see their own data
coverage. The payload analyzer (HaeAnalyzeCard) remains operator-only.

https://claude.ai/code/session_01EB8QMvqDxdSw3FT4sfNht2
@d3mocide d3mocide marked this pull request as ready for review June 16, 2026 15:08
@d3mocide d3mocide merged commit 87cfe26 into main Jun 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants