{# plugins/prometheus/templates/prometheus/target.html — one scrape target (milestone 506): what its newest scrape found, then every series it stored, grouped by metric, each with its labels and newest value and a link to its chart. A state set reads as one row per thing it describes, naming the current state (#5689). #} {% extends "base.html" %} {% from "_macros.html" import crumbs, page_header, status_badge, stat_tile %} {% block title %}Prometheus — {{ target.name }} — Steward{% endblock %} {% from "prometheus/_tabs.html" import prometheus_tabs %} {% block section_tabs %}{{ prometheus_tabs("targets") }}{% endblock %} {% block breadcrumb %}{{ crumbs([("Prometheus", "/plugins/prometheus/"), (target.name, "")]) }}{% endblock %} {% block content %} {% set admin = session.user_role == 'admin' %} {% call page_header(target.name, target.url) %} {% if admin %}Edit{% endif %} {% endcall %}
{% if target.reach == 'up' %}{{ status_badge('up', 'Answering') }} scraped {{ target.scraped_at|ago }}, every {{ target.interval|duration }} {% elif target.reach == 'down' %}{{ status_badge('down', 'Not answering') }} {{ target.says }} {% if target.ok_at %}Last answered {{ target.ok_at|ago }}; the values below are from then.{% else %}It has never answered.{% endif %} {% elif target.reach == 'stale' %}{{ status_badge('stale', 'Not scraped') }} {{ target.says }} {% elif target.reach == 'off' %}{{ status_badge('stale', 'Turned off') }} {{ target.says }} {% else %}{{ status_badge('pending', 'Not scraped yet') }} The first scrape runs within seconds of saving.{% endif %}
{% if target.capped %}{{ target.capped }} series weren't stored on the last scrape: past the cap of {{ target.cap }}, or a name too long to store. {% if admin %}Narrow what's kept or raise the cap.{% endif %}
{% endif %} {% if target.reach != 'pending' %}Keeping {{ target.keep|join(", ") if target.keep else "everything" }}{% if target.drop %}, leaving out {{ target.drop|join(", ") }}{% endif %}. Alert rules can watch any of these under Prometheus targets.
{% if q %}No stored metric matches “{{ q }}”.{% elif target.reach == 'pending' %}Nothing stored yet.{% else %}Nothing stored: the filters leave every series out, or the target hasn't answered.{% endif %}
{% else %}| Metric | Labels | Now |
|---|---|---|
| {{ g.metric }}
{%- if g.states %} a state set: the current state is shown {% endif %} | {% endif %}
{{ r.labels or "—" }} | {% if r.moment %}{{ r.moment|ago }}{% else %}{{ r.text }}{% endif %} |