Active Targets
{%= filtersForm(filter) %}
{%= targetsTabs(tsr, filter, "scrapeTargets") %}
{% import ( "net/url" "strconv" "strings" "github.com/VictoriaMetrics/VictoriaMetrics/lib/htmlcomponents" "github.com/VictoriaMetrics/VictoriaMetrics/lib/promutils" ) %} {% 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= ts.sw.Config.Labels.String() %},{% space %} {% if filter.showOriginalLabels %}originalLabels={%s= ts.sw.Config.OriginalLabels.String() %},{% space %}{% endif %} scrapes_total={%d ts.scrapesTotal %},{% space %} scrapes_failed={%d ts.scrapesFailed %},{% space %} last_scrape={%s= ts.getDurationFromLastScrape() %},{% space %} scrape_duration={%d int(ts.scrapeDuration) %}ms,{% space %} scrape_response_size={%s= ts.getSizeFromLastScrape() %},{% 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) %}
{%= htmlcomponents.CommonHeader() %}Endpoint | State | Labels | {% if hasOriginalLabels %}Debug relabeling | {% endif %}Scrapes | Errors | Last Scrape | Duration | Last Scrape Size | Samples | Last error |
---|---|---|---|---|---|---|---|---|---|---|
{%s endpoint %} {% if hasOriginalLabels %} {% space %} (response) {% endif %} | {% if ts.up %} UP {% else %} DOWN {% endif %} |
{%= formatLabels(ts.sw.Config.Labels) %}
{% if hasOriginalLabels %}
{% endif %}
|
{% if hasOriginalLabels %}
target{% space %} metrics | {% endif %}{%d ts.scrapesTotal %} | {%d ts.scrapesFailed %} | {%s ts.getDurationFromLastScrape() %} | {%d int(ts.scrapeDuration) %}ms | {%s ts.getSizeFromLastScrape() %} | {%d ts.samplesScraped %} | {% if ts.err != nil %}{%s ts.err.Error() %}{% endif %} |
Status | Discovered Labels | Target Labels | Debug relabeling |
---|---|---|---|
{% if t.up %}
UP
{% elseif t.labels.Len() > 0 %}
DOWN
{% else %}
DROPPED ({%s string(t.dropReason) %})
{% if len(t.clusterMemberNums) > 0 %}
exists at{% space %} {% for i, memberNum := range t.clusterMemberNums %} {% if *clusterMemberURLTemplate == "" %} shard-{%d memberNum %} {% else %} shard-{%d memberNum %} {% endif %} {% if i+1 < len(t.clusterMemberNums) %},{% space %}{% endif %} {% endfor %} {% endif %} {% endif %} |
{%= formatLabels(t.originalLabels) %} | {%= formatLabels(t.labels) %} | {% code targetID := getLabelsID(t.originalLabels) %} debug |