feat(prometheus): the Prometheus dashboard widget, target + template (#5691)
CI / lint (push) Successful in 3s
CI / integration (push) Successful in 1m14s
CI / unit (push) Successful in 1m29s
CI / publish (push) Successful in 1m12s

#5691 "Generic Prometheus dashboard widget: pick a target and a template",
step 3 of milestone 508 "Prometheus widget templates".

- /plugins/prometheus/widget draws one target with one template in widget
  shape: the verdict (led by "isn't answering" when the target is down),
  then each block with problems first, figures beside a share bar or the
  last 24h of bars, and the healthy rest folding to "+N more healthy" past
  six. A missing target or template, or one that no longer checks, says so.
- library.py: bundled templates from plugins/prometheus/widgets/*.yaml,
  the picker's target and template lists, and the default title.
- widgets/fabled_archives.yaml: the first bundled template, against the
  series Archives reports (refined in #5693).
- Dashboard: a widget setting may take `options_from` (read when the picker
  opens) with an `empty` sentence; `default_title`; a Details link may name
  settings ("/plugins/prometheus/targets/{target}"). Prometheus is grouped
  with the integrations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 07:05:15 -04:00
co-authored by Claude Opus 5.5
parent 4d95c5d0c2
commit 5ca13f9278
11 changed files with 551 additions and 8 deletions
+5 -3
View File
@@ -6,7 +6,9 @@
# "params" is a list of configurable parameters for the widget. Each param:
# key - form field name (stored in config_json)
# label - human-readable label
# type - "select" (only type currently supported)
# type - "select", or "host" for a live list of hosts
# options_from - async (db) -> options, read when the picker opens (a plugin's
# targets, its templates); "empty" is said when it returns none
# default - default value (int or str determines how it's parsed from the form)
# options - list of {value, label} dicts
#
@@ -353,9 +355,9 @@ def recommended_layout(plugins_cfg: dict) -> list[dict]:
# Group each widget for the picker (Core monitors / Monitoring capabilities /
# Integrations), mirroring the Settings → Plugins taxonomy. Capability plugins
# are host/monitoring facets; traefik/unifi are discrete vendor integrations.
# are host/monitoring facets; traefik/unifi/prometheus are discrete integrations.
_CORE_WIDGETS = {"monitors", "status_overview", "alerts", "hosts_overview"}
_INTEGRATION_PLUGINS = {"traefik", "unifi"}
_INTEGRATION_PLUGINS = {"traefik", "unifi", "prometheus"}
GROUP_LABELS = {
"core": "Core monitors",
"capability": "Monitoring capabilities",