{# plugins/prometheus/templates/prometheus/form.html — add or edit a scrape target (milestone 506): where its /metrics is, its token, how often, and what to keep, with Test to scrape it once before saving. The token is never sent back to the browser; a blank token field keeps the stored one. #} {% extends "base.html" %} {% from "_macros.html" import crumbs, page_header %} {% block title %}{{ ("Edit " ~ target.name) if target else "Add Prometheus target" }} — Steward{% endblock %} {% from "prometheus/_tabs.html" import prometheus_tabs %} {% block section_tabs %}{{ prometheus_tabs("targets") }}{% endblock %} {% block breadcrumb %} {%- if target -%} {{ crumbs([("Prometheus", "/plugins/prometheus/"), (target.name, "/plugins/prometheus/targets/" ~ target.id), ("Edit", "")]) }} {%- else -%} {{ crumbs([("Prometheus", "/plugins/prometheus/"), ("Add target", "")]) }} {%- endif -%} {% endblock %} {% block content %} {{ page_header(("Edit " ~ target.name) if target else "Add Prometheus target") }}
{% if error %}{% endif %}
{{ csrf_field() }} {% if target %}{% endif %}

Endpoint

How its series are named in Steward: alert rules and charts show it.
Sent as "Authorization: Bearer …". Blank {{ "keeps the saved one" if v.has_token else "sends none" }}. {% if v.has_token %} {% endif %}
Scraping… Scrapes the address once with what's typed here, filters included, and says what would be stored. Nothing is saved.

What to keep

The endpoint hands over everything; Steward stores what you choose. Patterns match the endpoint's metric names, with * for any run of characters.

One a line. Empty keeps everything.
One a line. Wins over Keep.
The most series stored from one scrape. Past it, the rest are counted and shown, not stored.

Gauges are stored as they are. Counters are stored as a rate per second, named …_per_sec, from the second scrape on. Histogram buckets and summary quantiles aren't stored; their _sum and _count are, as rates.

Cancel
{% if target %}

Delete this target

Steward stops scraping it. Its past series age out with the rest of the history.

{{ csrf_field() }}
{% endif %}
{% endblock %}