Skip to content

feat(terminal): add CLASS column to findings table + alert-fallback in METRIC#19

Merged
cicdteam merged 1 commit into
mainfrom
terminal-class-column
May 22, 2026
Merged

feat(terminal): add CLASS column to findings table + alert-fallback in METRIC#19
cicdteam merged 1 commit into
mainfrom
terminal-class-column

Conversation

@cicdteam

Copy link
Copy Markdown
Contributor

Summary

Two coupled UX improvements to the terminal scan table.

1. New CLASS column

Between SEVERITY and METRIC, showing each finding's stable class slug
(hot-label, label-pattern-overly-granular, never-firing-alert,
always-firing-alert, unused-metric, dashboard-sprawl).

The row is now self-identifying: severity tells importance, class tells type,
and the Reference: link in the detail block resolves directly to the
matching page at remetric.dev/findings/<class>. Width grows ~20 chars but
still fits a 132-col terminal.

2. Alert-finding fallback in METRIC column

Previously the alerthygiene analyzer's findings rendered with METRIC empty
(no metric exists for an alert rule). The CLASS column would say
never-firing-alert and the row showed empty METRIC, empty LABEL, 0 SERIES,
0 UNIQUE - looking like missing data.

Now when Metric is empty and Alert is set, the alert rule name (e.g.
RemetricNeverFired) renders in the METRIC column. The CLASS column tells
the reader the value is a rule name, not a metric name. No new ambiguity:
alert rule names are PascalCase, metric names are snake_case.

Empty METRIC for label-pattern-overly-granular findings stays empty -
those describe a global label, not per-metric, so empty is correct.

Sample (before / after)

Before:
│ MEDIUM   │                              │ user_id  │ 500    │ 500    │ ~499  │
│ MEDIUM   │                              │ trace_id │ 500    │ 500    │ ~499  │
│ MEDIUM   │                              │          │ 0      │ 0      │ ~0    │

After:
│ MEDIUM   │ label-pattern-overly-granular │                    │ user_id  │ 500 │ 500 │ ~499 │
│ MEDIUM   │ label-pattern-overly-granular │                    │ trace_id │ 500 │ 500 │ ~499 │
│ MEDIUM   │ never-firing-alert            │ RemetricNeverFired │          │ 0   │ 0   │ ~0   │

What changed

  • internal/output/terminal/findings.go: add CLASS column header + cell; Metric fallback to Alert.
  • internal/output/terminal/findings_test.go: Class: on each sampleFindings entry + new TestRenderFindings_ClassColumnAndAlertFallback regression test.
  • internal/output/terminal/testdata/findings_all_severities.golden: regenerated with the new column.
  • docs/getting-started.md: example output updated; "Reading the report" describes the CLASS column and the per-finding METRIC semantics.
  • demo/remetric.gif: regenerated against demo stack with the new binary.

Test plan

  • make fmt vet lint vuln clean.
  • go test -race ./... clean.
  • Real e2e scan output spot-checked for both happy-path and alert findings.
  • mkdocs build --strict clean.
  • CI green.
  • Post-merge: docs.yml redeploys; gif refreshed on README.

…for alerts

Two improvements to the scan table UX:

1. New CLASS column between SEVERITY and METRIC, showing the finding's stable
   slug (e.g. hot-label, label-pattern-overly-granular, never-firing-alert).
   The row is now self-identifying: severity tells importance, class tells
   type, and the Reference link in the detail block resolves directly to the
   per-class documentation page at remetric.dev/findings/<class>.

2. Alert findings (alerthygiene analyzer) previously rendered with empty
   METRIC column - the relevant entity is the alert rule name, but there
   was no place to put it. Now when Metric is empty and Alert is set, the
   rule name renders in the Metric column. The CLASS column makes the
   semantic unambiguous (e.g. CLASS=never-firing-alert tells the reader the
   value is a rule name, not a metric name).

Empty METRIC for label-pattern-overly-granular findings stays empty - those
findings describe a global label across many metrics, not per-metric, so
empty is semantically correct.

Updates the golden fixture, getting-started docs page, and the README gif.
@cicdteam cicdteam merged commit ad5f583 into main May 22, 2026
4 checks passed
@cicdteam cicdteam deleted the terminal-class-column branch May 22, 2026 19:48
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.

1 participant