mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-19 23:09:18 +01:00
lib/promscrape: add collapse
and expand
buttons per each group of targets from the same scrape job
This commit is contained in:
parent
6608705652
commit
74b8af9891
@ -7,6 +7,7 @@ sort: 15
|
||||
## tip
|
||||
|
||||
* FEATURE: vmalert: allow groups with empty rules list like Prometheus does. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/1742).
|
||||
* FEATURE: vmagent: add `collapse` and `expand` buttons per each group of targets with the same `job_name` at `http://vmagent:8429/targets` page.
|
||||
|
||||
* BUGFIX: vmagent: properly display `proxy_url` config option at `http://vmagent:8429/config` page. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1755).
|
||||
* BUGFIX: fix tests for Apple M1. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1653).
|
||||
|
@ -32,7 +32,7 @@ job={%q= jobName %} (0/0 up)
|
||||
|
||||
{% endfunc %}
|
||||
|
||||
{% func TargetsResponseHTML(jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) %}
|
||||
{% func TargetsResponseHTML(jts []jobTargetsStatuses, emptyJobs []string, onlyUnhealthy bool) %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -44,12 +44,10 @@ job={%q= jobName %} (0/0 up)
|
||||
<body class="m-3">
|
||||
<h1>Scrape targets</h1>
|
||||
<div>
|
||||
<button type="button" class="btn{% space %} {% if !onlyUnhealthy %}btn-primary{% else %}btn-secondary{% endif %}"
|
||||
{% if onlyUnhealthy %}onclick="location.href='{%s redirectPath %}'"{% endif %}>
|
||||
<button type="button" class="btn{% space %}{% if !onlyUnhealthy %}btn-primary{% else %}btn-secondary{% endif %}" onclick="location.href='targets'">
|
||||
All
|
||||
</button>
|
||||
<button type="button" class="btn{% space %}{% if onlyUnhealthy %}btn-primary{% else %}btn-secondary{% endif %}"
|
||||
{% if !onlyUnhealthy %}onclick="location.href='{%s= redirectPath %}?show_only_unhealthy=true'"{% endif %}>
|
||||
<button type="button" class="btn{% space %}{% if onlyUnhealthy %}btn-primary{% else %}btn-secondary{% endif %}" onclick="location.href='targets?show_only_unhealthy=true'">
|
||||
Unhealthy
|
||||
</button>
|
||||
</div>
|
||||
@ -57,8 +55,11 @@ job={%q= jobName %} (0/0 up)
|
||||
{% if onlyUnhealthy && js.upCount == js.targetsTotal %}{% continue %}{% endif %}
|
||||
<div>
|
||||
<h4>
|
||||
<a>{%s js.job %} ({%d js.upCount %}/{%d js.targetsTotal %} up)</a>
|
||||
{%s js.job %}{% space %}({%d js.upCount %}/{%d js.targetsTotal %}{% space %}up)
|
||||
<button type="button" class="btn btn-primary" onclick="document.getElementById('table-{%d i %}').style.display='none'">collapse</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="document.getElementById('table-{%d i %}').style.display='block'">expand</button>
|
||||
</h4>
|
||||
<div id="table-{%d i %}">
|
||||
<table class="table table-striped table-hover table-bordered table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -93,6 +94,7 @@ job={%q= jobName %} (0/0 up)
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
|
@ -169,7 +169,7 @@ func TargetsResponsePlain(jts []jobTargetsStatuses, emptyJobs []string, showOrig
|
||||
}
|
||||
|
||||
//line lib/promscrape/targets_response.qtpl:35
|
||||
func StreamTargetsResponseHTML(qw422016 *qt422016.Writer, jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) {
|
||||
func StreamTargetsResponseHTML(qw422016 *qt422016.Writer, jts []jobTargetsStatuses, emptyJobs []string, onlyUnhealthy bool) {
|
||||
//line lib/promscrape/targets_response.qtpl:35
|
||||
qw422016.N().S(`<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"><title>Scrape targets</title></head><body class="m-3"><h1>Scrape targets</h1><div><button type="button" class="btn`)
|
||||
//line lib/promscrape/targets_response.qtpl:47
|
||||
@ -185,255 +185,247 @@ func StreamTargetsResponseHTML(qw422016 *qt422016.Writer, jts []jobTargetsStatus
|
||||
//line lib/promscrape/targets_response.qtpl:47
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:47
|
||||
qw422016.N().S(`"`)
|
||||
//line lib/promscrape/targets_response.qtpl:48
|
||||
if onlyUnhealthy {
|
||||
//line lib/promscrape/targets_response.qtpl:48
|
||||
qw422016.N().S(`onclick="location.href='`)
|
||||
//line lib/promscrape/targets_response.qtpl:48
|
||||
qw422016.E().S(redirectPath)
|
||||
//line lib/promscrape/targets_response.qtpl:48
|
||||
qw422016.N().S(`'"`)
|
||||
//line lib/promscrape/targets_response.qtpl:48
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:48
|
||||
qw422016.N().S(`>All</button><button type="button" class="btn`)
|
||||
//line lib/promscrape/targets_response.qtpl:51
|
||||
qw422016.N().S(`" onclick="location.href='targets'">All</button><button type="button" class="btn`)
|
||||
//line lib/promscrape/targets_response.qtpl:50
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:51
|
||||
//line lib/promscrape/targets_response.qtpl:50
|
||||
if onlyUnhealthy {
|
||||
//line lib/promscrape/targets_response.qtpl:51
|
||||
//line lib/promscrape/targets_response.qtpl:50
|
||||
qw422016.N().S(`btn-primary`)
|
||||
//line lib/promscrape/targets_response.qtpl:51
|
||||
//line lib/promscrape/targets_response.qtpl:50
|
||||
} else {
|
||||
//line lib/promscrape/targets_response.qtpl:51
|
||||
//line lib/promscrape/targets_response.qtpl:50
|
||||
qw422016.N().S(`btn-secondary`)
|
||||
//line lib/promscrape/targets_response.qtpl:51
|
||||
//line lib/promscrape/targets_response.qtpl:50
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:51
|
||||
qw422016.N().S(`"`)
|
||||
//line lib/promscrape/targets_response.qtpl:52
|
||||
if !onlyUnhealthy {
|
||||
//line lib/promscrape/targets_response.qtpl:52
|
||||
qw422016.N().S(`onclick="location.href='`)
|
||||
//line lib/promscrape/targets_response.qtpl:52
|
||||
qw422016.N().S(redirectPath)
|
||||
//line lib/promscrape/targets_response.qtpl:52
|
||||
qw422016.N().S(`?show_only_unhealthy=true'"`)
|
||||
//line lib/promscrape/targets_response.qtpl:52
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:52
|
||||
qw422016.N().S(`>Unhealthy</button></div>`)
|
||||
//line lib/promscrape/targets_response.qtpl:56
|
||||
//line lib/promscrape/targets_response.qtpl:50
|
||||
qw422016.N().S(`" onclick="location.href='targets?show_only_unhealthy=true'">Unhealthy</button></div>`)
|
||||
//line lib/promscrape/targets_response.qtpl:54
|
||||
for i, js := range jts {
|
||||
//line lib/promscrape/targets_response.qtpl:57
|
||||
//line lib/promscrape/targets_response.qtpl:55
|
||||
if onlyUnhealthy && js.upCount == js.targetsTotal {
|
||||
//line lib/promscrape/targets_response.qtpl:57
|
||||
//line lib/promscrape/targets_response.qtpl:55
|
||||
continue
|
||||
//line lib/promscrape/targets_response.qtpl:57
|
||||
//line lib/promscrape/targets_response.qtpl:55
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:57
|
||||
qw422016.N().S(`<div><h4><a>`)
|
||||
//line lib/promscrape/targets_response.qtpl:60
|
||||
//line lib/promscrape/targets_response.qtpl:55
|
||||
qw422016.N().S(`<div><h4>`)
|
||||
//line lib/promscrape/targets_response.qtpl:58
|
||||
qw422016.E().S(js.job)
|
||||
//line lib/promscrape/targets_response.qtpl:60
|
||||
//line lib/promscrape/targets_response.qtpl:58
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:58
|
||||
qw422016.N().S(`(`)
|
||||
//line lib/promscrape/targets_response.qtpl:60
|
||||
//line lib/promscrape/targets_response.qtpl:58
|
||||
qw422016.N().D(js.upCount)
|
||||
//line lib/promscrape/targets_response.qtpl:60
|
||||
//line lib/promscrape/targets_response.qtpl:58
|
||||
qw422016.N().S(`/`)
|
||||
//line lib/promscrape/targets_response.qtpl:60
|
||||
//line lib/promscrape/targets_response.qtpl:58
|
||||
qw422016.N().D(js.targetsTotal)
|
||||
//line lib/promscrape/targets_response.qtpl:58
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:58
|
||||
qw422016.N().S(`up)<button type="button" class="btn btn-primary" onclick="document.getElementById('table-`)
|
||||
//line lib/promscrape/targets_response.qtpl:59
|
||||
qw422016.N().D(i)
|
||||
//line lib/promscrape/targets_response.qtpl:59
|
||||
qw422016.N().S(`').style.display='none'">collapse</button><button type="button" class="btn btn-secondary" onclick="document.getElementById('table-`)
|
||||
//line lib/promscrape/targets_response.qtpl:60
|
||||
qw422016.N().S(`up)</a></h4><table class="table table-striped table-hover table-bordered table-sm"><thead><tr><th scope="col">Endpoint</th><th scope="col">State</th><th scope="col">Labels</th><th scope="col">Last Scrape</th><th scope="col">Scrape Duration</th><th scope="col">Samples Scraped</th><th scope="col">Error</th></tr></thead><tbody>`)
|
||||
//line lib/promscrape/targets_response.qtpl:75
|
||||
qw422016.N().D(i)
|
||||
//line lib/promscrape/targets_response.qtpl:60
|
||||
qw422016.N().S(`').style.display='block'">expand</button></h4><div id="table-`)
|
||||
//line lib/promscrape/targets_response.qtpl:62
|
||||
qw422016.N().D(i)
|
||||
//line lib/promscrape/targets_response.qtpl:62
|
||||
qw422016.N().S(`"><table class="table table-striped table-hover table-bordered table-sm"><thead><tr><th scope="col">Endpoint</th><th scope="col">State</th><th scope="col">Labels</th><th scope="col">Last Scrape</th><th scope="col">Scrape Duration</th><th scope="col">Samples Scraped</th><th scope="col">Error</th></tr></thead><tbody>`)
|
||||
//line lib/promscrape/targets_response.qtpl:76
|
||||
for j, ts := range js.targetsStatus {
|
||||
//line lib/promscrape/targets_response.qtpl:76
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
if onlyUnhealthy && ts.up {
|
||||
//line lib/promscrape/targets_response.qtpl:76
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
continue
|
||||
//line lib/promscrape/targets_response.qtpl:76
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:76
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
qw422016.N().S(`<tr`)
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
if !ts.up {
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
qw422016.N().S(`class="alert alert-danger" role="alert"`)
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:77
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
qw422016.N().S(`><td><a href="`)
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
qw422016.E().S(ts.endpoint)
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
qw422016.N().S(`">`)
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
qw422016.E().S(ts.endpoint)
|
||||
//line lib/promscrape/targets_response.qtpl:78
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
qw422016.N().S(`</a><br></td><td>`)
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
//line lib/promscrape/targets_response.qtpl:80
|
||||
if ts.up {
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
//line lib/promscrape/targets_response.qtpl:80
|
||||
qw422016.N().S(`UP`)
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
//line lib/promscrape/targets_response.qtpl:80
|
||||
} else {
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
//line lib/promscrape/targets_response.qtpl:80
|
||||
qw422016.N().S(`DOWN`)
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
//line lib/promscrape/targets_response.qtpl:80
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:79
|
||||
//line lib/promscrape/targets_response.qtpl:80
|
||||
qw422016.N().S(`</td><td><button type="button" class="btn btn-sm btn-outline-info" onclick="document.getElementById('original_labels_`)
|
||||
//line lib/promscrape/targets_response.qtpl:81
|
||||
//line lib/promscrape/targets_response.qtpl:82
|
||||
qw422016.N().D(i)
|
||||
//line lib/promscrape/targets_response.qtpl:81
|
||||
//line lib/promscrape/targets_response.qtpl:82
|
||||
qw422016.N().S(`_`)
|
||||
//line lib/promscrape/targets_response.qtpl:81
|
||||
//line lib/promscrape/targets_response.qtpl:82
|
||||
qw422016.N().D(j)
|
||||
//line lib/promscrape/targets_response.qtpl:81
|
||||
//line lib/promscrape/targets_response.qtpl:82
|
||||
qw422016.N().S(`').style.display='block'">show original labels</button>`)
|
||||
//line lib/promscrape/targets_response.qtpl:81
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:82
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:83
|
||||
streamformatLabel(qw422016, ts.labels)
|
||||
//line lib/promscrape/targets_response.qtpl:82
|
||||
//line lib/promscrape/targets_response.qtpl:83
|
||||
qw422016.N().S(`<div style="display:none" id="original_labels_`)
|
||||
//line lib/promscrape/targets_response.qtpl:83
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
qw422016.N().D(i)
|
||||
//line lib/promscrape/targets_response.qtpl:83
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
qw422016.N().S(`_`)
|
||||
//line lib/promscrape/targets_response.qtpl:83
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
qw422016.N().D(j)
|
||||
//line lib/promscrape/targets_response.qtpl:83
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
qw422016.N().S(`"><button type="button" class="btn btn-sm btn-outline-info" onclick="document.getElementById('original_labels_`)
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
//line lib/promscrape/targets_response.qtpl:85
|
||||
qw422016.N().D(i)
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
//line lib/promscrape/targets_response.qtpl:85
|
||||
qw422016.N().S(`_`)
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
//line lib/promscrape/targets_response.qtpl:85
|
||||
qw422016.N().D(j)
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
//line lib/promscrape/targets_response.qtpl:85
|
||||
qw422016.N().S(`').style.display='none'">hide original labels</button>`)
|
||||
//line lib/promscrape/targets_response.qtpl:84
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:85
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:86
|
||||
streamformatLabel(qw422016, ts.originalLabels)
|
||||
//line lib/promscrape/targets_response.qtpl:85
|
||||
//line lib/promscrape/targets_response.qtpl:86
|
||||
qw422016.N().S(`</div></td><td>`)
|
||||
//line lib/promscrape/targets_response.qtpl:88
|
||||
//line lib/promscrape/targets_response.qtpl:89
|
||||
qw422016.N().FPrec(ts.lastScrapeTime.Seconds(), 3)
|
||||
//line lib/promscrape/targets_response.qtpl:88
|
||||
//line lib/promscrape/targets_response.qtpl:89
|
||||
qw422016.N().S(`s ago</td><td>`)
|
||||
//line lib/promscrape/targets_response.qtpl:89
|
||||
//line lib/promscrape/targets_response.qtpl:90
|
||||
qw422016.N().FPrec(ts.scrapeDuration.Seconds(), 3)
|
||||
//line lib/promscrape/targets_response.qtpl:89
|
||||
//line lib/promscrape/targets_response.qtpl:90
|
||||
qw422016.N().S(`s</td><td>`)
|
||||
//line lib/promscrape/targets_response.qtpl:90
|
||||
//line lib/promscrape/targets_response.qtpl:91
|
||||
qw422016.N().D(ts.samplesScraped)
|
||||
//line lib/promscrape/targets_response.qtpl:90
|
||||
//line lib/promscrape/targets_response.qtpl:91
|
||||
qw422016.N().S(`</td><td>`)
|
||||
//line lib/promscrape/targets_response.qtpl:91
|
||||
//line lib/promscrape/targets_response.qtpl:92
|
||||
qw422016.E().S(ts.errMsg)
|
||||
//line lib/promscrape/targets_response.qtpl:91
|
||||
//line lib/promscrape/targets_response.qtpl:92
|
||||
qw422016.N().S(`</td></tr>`)
|
||||
//line lib/promscrape/targets_response.qtpl:93
|
||||
//line lib/promscrape/targets_response.qtpl:94
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:93
|
||||
qw422016.N().S(`</tbody></table></div>`)
|
||||
//line lib/promscrape/targets_response.qtpl:97
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:94
|
||||
qw422016.N().S(`</tbody></table></div></div>`)
|
||||
//line lib/promscrape/targets_response.qtpl:99
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:101
|
||||
for _, jobName := range emptyJobs {
|
||||
//line lib/promscrape/targets_response.qtpl:99
|
||||
//line lib/promscrape/targets_response.qtpl:101
|
||||
qw422016.N().S(`<div><h4><a>`)
|
||||
//line lib/promscrape/targets_response.qtpl:102
|
||||
//line lib/promscrape/targets_response.qtpl:104
|
||||
qw422016.E().S(jobName)
|
||||
//line lib/promscrape/targets_response.qtpl:102
|
||||
//line lib/promscrape/targets_response.qtpl:104
|
||||
qw422016.N().S(`(0/0 up)</a></h4><table class="table table-striped table-hover table-bordered table-sm"><thead><tr><th scope="col">Endpoint</th><th scope="col">State</th><th scope="col">Labels</th><th scope="col">Last Scrape</th><th scope="col">Scrape Duration</th><th scope="col">Samples Scraped</th><th scope="col">Error</th></tr></thead></table></div>`)
|
||||
//line lib/promscrape/targets_response.qtpl:118
|
||||
//line lib/promscrape/targets_response.qtpl:120
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:118
|
||||
//line lib/promscrape/targets_response.qtpl:120
|
||||
qw422016.N().S(`</body></html>`)
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
}
|
||||
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
func WriteTargetsResponseHTML(qq422016 qtio422016.Writer, jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) {
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
func WriteTargetsResponseHTML(qq422016 qtio422016.Writer, jts []jobTargetsStatuses, emptyJobs []string, onlyUnhealthy bool) {
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
StreamTargetsResponseHTML(qw422016, jts, emptyJobs, redirectPath, onlyUnhealthy)
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
StreamTargetsResponseHTML(qw422016, jts, emptyJobs, onlyUnhealthy)
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
}
|
||||
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
func TargetsResponseHTML(jts []jobTargetsStatuses, emptyJobs []string, redirectPath string, onlyUnhealthy bool) string {
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
func TargetsResponseHTML(jts []jobTargetsStatuses, emptyJobs []string, onlyUnhealthy bool) string {
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
WriteTargetsResponseHTML(qb422016, jts, emptyJobs, redirectPath, onlyUnhealthy)
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
WriteTargetsResponseHTML(qb422016, jts, emptyJobs, onlyUnhealthy)
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
qs422016 := string(qb422016.B)
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
return qs422016
|
||||
//line lib/promscrape/targets_response.qtpl:121
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
}
|
||||
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
func streamformatLabel(qw422016 *qt422016.Writer, labels []prompbmarshal.Label) {
|
||||
//line lib/promscrape/targets_response.qtpl:123
|
||||
qw422016.N().S(`{`)
|
||||
//line lib/promscrape/targets_response.qtpl:125
|
||||
func streamformatLabel(qw422016 *qt422016.Writer, labels []prompbmarshal.Label) {
|
||||
//line lib/promscrape/targets_response.qtpl:125
|
||||
qw422016.N().S(`{`)
|
||||
//line lib/promscrape/targets_response.qtpl:127
|
||||
for i, label := range labels {
|
||||
//line lib/promscrape/targets_response.qtpl:126
|
||||
//line lib/promscrape/targets_response.qtpl:128
|
||||
qw422016.E().S(label.Name)
|
||||
//line lib/promscrape/targets_response.qtpl:126
|
||||
//line lib/promscrape/targets_response.qtpl:128
|
||||
qw422016.N().S(`=`)
|
||||
//line lib/promscrape/targets_response.qtpl:126
|
||||
//line lib/promscrape/targets_response.qtpl:128
|
||||
qw422016.E().Q(label.Value)
|
||||
//line lib/promscrape/targets_response.qtpl:127
|
||||
//line lib/promscrape/targets_response.qtpl:129
|
||||
if i+1 < len(labels) {
|
||||
//line lib/promscrape/targets_response.qtpl:127
|
||||
//line lib/promscrape/targets_response.qtpl:129
|
||||
qw422016.N().S(`,`)
|
||||
//line lib/promscrape/targets_response.qtpl:127
|
||||
//line lib/promscrape/targets_response.qtpl:129
|
||||
qw422016.N().S(` `)
|
||||
//line lib/promscrape/targets_response.qtpl:127
|
||||
//line lib/promscrape/targets_response.qtpl:129
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:128
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
}
|
||||
//line lib/promscrape/targets_response.qtpl:128
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
qw422016.N().S(`}`)
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
}
|
||||
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
func writeformatLabel(qq422016 qtio422016.Writer, labels []prompbmarshal.Label) {
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
streamformatLabel(qw422016, labels)
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
}
|
||||
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
func formatLabel(labels []prompbmarshal.Label) string {
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
writeformatLabel(qb422016, labels)
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
qs422016 := string(qb422016.B)
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
return qs422016
|
||||
//line lib/promscrape/targets_response.qtpl:130
|
||||
//line lib/promscrape/targets_response.qtpl:132
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"path"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -13,7 +12,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promrelabel"
|
||||
)
|
||||
@ -363,8 +361,7 @@ func getEmptyJobs(jts []jobTargetsStatuses, jobNames []string) []string {
|
||||
// accepts filter to show only unhealthy targets.
|
||||
func (tsm *targetStatusMap) WriteTargetsHTML(w io.Writer, showOnlyUnhealthy bool) {
|
||||
jss, emptyJobs := tsm.getTargetsStatusByJob()
|
||||
targetsPath := path.Join(httpserver.GetPathPrefix(), "/targets")
|
||||
WriteTargetsResponseHTML(w, jss, emptyJobs, targetsPath, showOnlyUnhealthy)
|
||||
WriteTargetsResponseHTML(w, jss, emptyJobs, showOnlyUnhealthy)
|
||||
}
|
||||
|
||||
// WriteTargetsPlain writes targets grouped by job into writer w in plain text,
|
||||
|
Loading…
Reference in New Issue
Block a user