{% import "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" %} {% stripspace %} {% func TargetsResponsePlain (jts []jobTargetsStatuses, showOriginLabels bool) -%} {% for _, js := range jts %} job={%q= js.job %}{% space %} ({%d js.upCount %}/{%d js.targetsTotal %} {% space %} 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 %}, {% space %} endpoint={%s= ts.endpoint %}, {% space %} labels={%s= labels %} {% if showOriginLabels %},{% space %} originalLabels={%s= ol %}{% endif %}, {% space %} last_scrape={%f.3 ts.lastScrapeTime.Seconds() %}s {% space %} ago, {% space %} scrape_duration={%f.3 ts.scrapeDuration.Seconds() %}s, {% space %} error={%q= ts.error %} {% newline %} {% endfor %} {% endfor %} {% newline %} {% endfunc %} {% func TargetsResponseHTML(jts []jobTargetsStatuses, redirectPath string, onlyUnhealthy bool) %} Scrape targets

Targets


{% for _,js :=range jts %}

{%q 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 Error
{%s ts.endpoint %}
{% if ts.up %}UP{% else %}DOWN{% endif %} {%= formatLabel(ts.labels) %} {%f.3 ts.lastScrapeTime.Seconds() %}s {% space %} ago {%f.3 ts.scrapeDuration.Seconds() %}s {%s ts.error %}
{% endfor %} {% endfunc %} {% func formatLabel(labels []prompbmarshal.Label) %} {% for _, label := range labels %} {% space %} {%s label.Name %}={%q label.Value %} {% space %} {% endfor %} {% endfunc %} {% endstripspace %}