feat(terminal): add CLASS column to findings table + alert-fallback in METRIC#19
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two coupled UX improvements to the terminal scan table.
1. New
CLASScolumnBetween
SEVERITYandMETRIC, 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 thematching page at
remetric.dev/findings/<class>. Width grows ~20 chars butstill fits a 132-col terminal.
2. Alert-finding fallback in
METRICcolumnPreviously the alerthygiene analyzer's findings rendered with
METRICempty(no metric exists for an alert rule). The CLASS column would say
never-firing-alertand the row showed empty METRIC, empty LABEL, 0 SERIES,0 UNIQUE - looking like missing data.
Now when
Metricis empty andAlertis set, the alert rule name (e.g.RemetricNeverFired) renders in theMETRICcolumn. The CLASS column tellsthe 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
METRICforlabel-pattern-overly-granularfindings stays empty -those describe a global label, not per-metric, so empty is correct.
Sample (before / after)
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 + newTestRenderFindings_ClassColumnAndAlertFallbackregression 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 vulnclean.go test -race ./...clean.mkdocs build --strictclean.