Prometheus Design System v0.2.0 — WIP

PoolAccordion

Accordion component for scrape pool and target group display.

Description

Accordion component for scrape pool and target group display. Combines HealthPanel with pool-specific header layout including stats badges and target counts.

✓ Do
  • Targets page scrape pool groups
  • Service Discovery discovered pool groups
  • Any grouped list with health status and counts
✗ Don’t
  • Alert/rule groups (use HealthPanel directly)
  • Non-grouped content
  • Custom accordion layouts with manual health borders

Design

PoolAccordion Example
▸ prometheus
3 up3 targets
▸ node_exporter
2 up1 down3 targets

PoolAccordionItemProps

PropertyTypeDescription
namestringPool name (used as accordion value)
statusHealthPanelStatusOverall pool health
statsPoolStatsPool statistics (counts per state)
childrenReact.ReactNodePanel content
Where this component exists in the Prometheus UI
View in Prometheus UI → /targets PoolAccordion on the Targets page — scrape pool grouping

PoolAccordion on the Targets page — scrape pool grouping

View in Prometheus UI → /service-discovery PoolAccordion on the Service Discovery page

PoolAccordion on the Service Discovery page

Implementation

From pages/targets/ScrapePoolsList.tsx in the Prometheus codebase:

<Accordion multiple variant="separated" keepMounted={false}
  value={allPoolNames.filter((p) => !collapsedPools.includes(p))}
  onChange={(value) =>
    dispatch(setCollapsedPools(allPoolNames.filter((p) => !value.includes(p))))
  }
>
  {shownPoolNames.map((poolName) => {
    const pool = allPools[poolName];
    return (
      <Accordion.Item key={poolName} value={poolName}
        className={poolPanelHealthClass(pool)}>
        <Accordion.Control>
          <Group wrap="nowrap" justify="space-between" mr="lg">
            <Text>{poolName}</Text>
            <Text c="gray.6">{pool.upCount} / {pool.count} up</Text>
          </Group>
        </Accordion.Control>
      </Accordion.Item>
    );
  })}
</Accordion>

Layout Specs

PropertyValue
Item Border Radius6px
Item Border Width1px
Item Margin Bottom8px
Header Padding10px 16px (0.625rem 1rem)
Panel Left Border5px (via HealthPanel)
Title Font Size14px (sm)
Title Font Weight600 (semibold)
Stats Badge Gap6px (0.375rem)

Accessibility