{% 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 ago, {% space %} scrape_duration={%f.3 float64(ts.scrapeDuration.Seconds()) %}s, {% space %} error={%q= ts.error %} {% newline %} {% endfor %} {% endfor %} {% newline %} {% endfunc %} {% func TargetsResponseHTML(jts []jobTargetsStatuses, redirectPath string, onlyUnhealthy bool) %}
Endpoint | State | Labels | Last Scrape | Scrape Duration | Error |
---|---|---|---|---|---|
{%s= ts.endpoint %} |
{% if ts.up %}UP{% else %}DOWN{% endif %} | {%= formatLabel(ts.labels) %} | {%s ts.lastScrapeTime.String() %} ago | {%s ts.scrapeDuration.String() %} | {%s= ts.error %} |