{% import "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" %} {% collapsespace %} {% func TargetsResponsePlain (jts []jobTargetsStatuses, showOriginLabels bool) -%} {% for _, js := range jts %} job={%q= js.job %} ({%d js.upCount %}/{%d js.targetsTotal %} up) {% newline %} {% for _, ts := range js.targetsStatus %} {% code labels := promLabelsString(ts.labels) ol := promLabelsString(ts.originalLabels) %} {%s= "\t" %}state={% if ts.up %}up{% else %}down{% endif %}, endpoint={%s= ts.endpoint %}, labels={%s= labels %} {% if showOriginLabels %}, originalLabels={%s= ol %}{% endif %}, last_scrape={%f.3 ts.lastScrapeTime.Seconds() %}s ago, scrape_duration={%f.3 ts.scrapeDuration.Seconds() %}s, samples_scraped={%d ts.samplesScraped %}, error={%q= ts.errMsg %} {% newline %} {% endfor %} {% endfor %} {% newline %} {% endfunc %} {% func TargetsResponseHTML(jts []jobTargetsStatuses, redirectPath string, onlyUnhealthy bool) %} Scrape targets

Scrape targets

{% for _,js :=range jts %} {% if onlyUnhealthy && js.upCount == js.targetsTotal %}{% continue %}{% endif %}

{%s js.job %} ({%d js.upCount %}/{%d js.targetsTotal %} up)

{% for _, ts := range js.targetsStatus %} {% if onlyUnhealthy && ts.up %}{% continue %}{% endif %} {% endfor %}
Endpoint State Labels Last Scrape Scrape Duration Samples Scraped Error
{%s ts.endpoint %}
{% if ts.up %}UP{% else %}DOWN{% endif %} {%= formatLabel(ts.labels) %} {%f.3 ts.lastScrapeTime.Seconds() %}s ago {%f.3 ts.scrapeDuration.Seconds() %}s {%d ts.samplesScraped %} {%s ts.errMsg %}
{% endfor %} {% endfunc %} {% func formatLabel(labels []prompbmarshal.Label) %} {% for _, label := range labels %} {%s label.Name %}={%q label.Value %} {% space %} {% endfor %} {% endfunc %} {% endcollapsespace %}