Prometheus Design System v0.2.0 — WIP

StatusBadge

Unified health/state badge that resolves the fragmented badge system in the Prometheus UI.

Description

Unified health/state badge that resolves the fragmented badge system in the Prometheus UI. A single component handles all status vocabularies across alerts, rules, targets, and service discovery pages.

✓ Do
  • All health/state display across alerts, targets, rules, and SD pages
  • Pass the raw status string and let the component normalize it
  • Neutral counts via the stats variant
✗ Don’t
  • Decorative coloring unrelated to health state
  • Interactive elements (use a button instead)
  • Mantine Badge with manual color props or separate per-page badge implementations

Design

Health Variants
up ok active down firing err pending stale info unknown inactive dropped
Sizes
sm md (default) lg
Stats Variant (neutral)
3 / 3 active 42 targets 0 rules

Status Normalization

All status vocabularies are normalized to five canonical states:

CanonicalColorInput Aliases
okGreenok, up, active
errRederr, down, firing
warnYellowwarn, pending, stale
infoBlueinfo
unknownGrayunknown, inactive, dropped, none
Where this component exists in the Prometheus UI
View in Prometheus UI → /alerts StatusBadge on the Alerts page — firing/pending/inactive badges

StatusBadge on the Alerts page — firing/pending/inactive badges

View in Prometheus UI → /targets StatusBadge on the Targets page — up/down health indicators

StatusBadge on the Targets page — up/down health indicators

View in Prometheus UI → /rules StatusBadge on the Rules page — ok/err state badges

StatusBadge on the Rules page — ok/err state badges

Implementation

From Badge.module.css + pages/AlertsPage.tsx in the Prometheus codebase:

/* Badge.module.css */
.healthOk {
  background-color: light-dark(
    var(--mantine-color-green-1),
    var(--mantine-color-green-9)
  );
  color: light-dark(var(--mantine-color-green-9), var(--mantine-color-green-1));
}

.healthErr {
  background-color: light-dark(
    var(--mantine-color-red-1),
    darken(var(--mantine-color-red-9), 0.25)
  );
  color: light-dark(var(--mantine-color-red-9), var(--mantine-color-red-1));
}

/* AlertsPage.tsx usage */
{g.counts.firing > 0 && (
  <Badge className={badgeClasses.healthErr}>
    firing ({g.counts.firing})
  </Badge>
)}

Layout Specs

Propertysmmdlg
Height20px22px26px
Padding (horizontal)8px10px12px
Font Size10px11px12px
Border Radius999px (pill)
Border Widthnone
Letter Spacing0.02em

Accessibility