Active Targets
{%= filtersForm(filter) %}
{%= targetsTabs(tsr, filter, "scrapeTargets") %}
{% import ( "net/url" "time" "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" "github.com/VictoriaMetrics/VictoriaMetrics/lib/promrelabel" ) %} {% stripspace %} {% func TargetsResponsePlain(tsr *targetsStatusResult, filter *requestFilter) %} {% if tsr.err != nil %} {%s= tsr.err.Error() %} {% return %} {% endif %} {% for _, jts := range tsr.jobTargetsStatuses %} job={%s= jts.jobName %}{% space %}({%d jts.upCount %}/{%d jts.targetsTotal %}{% space %}up) {% newline %} {% for _, ts := range jts.targetsStatus %} {%s= "\t" %} state={% if ts.up %}up{% else %}down{% endif %},{% space %} endpoint={%s= ts.sw.Config.ScrapeURL %},{% space %} labels={%s= promLabelsString(promrelabel.FinalizeLabels(nil, ts.sw.Config.Labels)) %},{% space %} {% if filter.showOriginalLabels %}originalLabels={%s= promLabelsString(ts.sw.Config.OriginalLabels) %},{% space %}{% endif %} scrapes_total={%d ts.scrapesTotal %},{% space %} scrapes_failed={%d ts.scrapesFailed %},{% space %} last_scrape={%d int(ts.getDurationFromLastScrape().Milliseconds()) %}ms ago,{% space %} scrape_duration={%d int(ts.scrapeDuration) %}ms,{% space %} samples_scraped={%d ts.samplesScraped %},{% space %} error={% if ts.err != nil %}{%s= ts.err.Error() %}{% endif %} {% newline %} {% endfor %} {% endfor %} {% for _, jobName := range tsr.emptyJobs %} job={%s= jobName %}{% space %}(0/0 up) {% newline %} {% endfor %} {% endfunc %} {% func TargetsResponseHTML(tsr *targetsStatusResult, filter *requestFilter) %}
{%= commonHeader() %}Endpoint | State | Labels | Scrapes | Errors | Last Scrape | Duration | Samples | Last error |
---|---|---|---|---|---|---|---|---|
{%s endpoint %} ( response ) | {% if ts.up %} UP {% else %} DOWN {% endif %} |
{%= formatLabel(promrelabel.FinalizeLabels(nil, ts.sw.Config.Labels)) %}
|
{%d ts.scrapesTotal %} | {%d ts.scrapesFailed %} | {% if lastScrapeDuration < 365*24*time.Hour %} {%d int(lastScrapeDuration.Milliseconds()) %}ms ago {% else %} none {% endif %} | {%d int(ts.scrapeDuration) %}ms | {%d ts.samplesScraped %} | {% if ts.err != nil %}{%s ts.err.Error() %}{% endif %} |
Status | Discovered Labels | Target Labels |
---|---|---|
{% if t.up %} UP {% elseif len(t.labels) > 0 %} DOWN {% else %} DROPPED {% endif %} | {%= formatLabel(t.discoveredLabels) %} | {%= formatLabel(promrelabel.FinalizeLabels(nil, t.labels)) %} |