mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-21 15:45:01 +00:00
lib/promscrape: pre-fetch metric_relabel_configs rules when debugging metric relabeling for a particular target
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3407
This commit is contained in:
parent
a1076abcbf
commit
0dea3b71da
10 changed files with 475 additions and 529 deletions
|
@ -604,8 +604,8 @@ provide the following tools for debugging target-level and metric-level relabeli
|
||||||
|
|
||||||
- Target-level debugging (e.g. `relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs))
|
- Target-level debugging (e.g. `relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs))
|
||||||
can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics)
|
can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics)
|
||||||
and clicking the `debug` link at the target, which must be debugged.
|
and clicking the `debug target relabeling` link at the target, which must be debugged.
|
||||||
The opened page will show step-by-step results for the actual relabeling rules applied to the target labels.
|
The opened page will show step-by-step results for the actual target relabeling rules applied to the discovered target labels.
|
||||||
|
|
||||||
The `http://vmagent:8429/targets` page shows only active targets. If you need to understand why some target
|
The `http://vmagent:8429/targets` page shows only active targets. If you need to understand why some target
|
||||||
is dropped during the relabeling, then navigate to `http://vmagent:8428/service-discovery` page
|
is dropped during the relabeling, then navigate to `http://vmagent:8428/service-discovery` page
|
||||||
|
@ -614,11 +614,9 @@ provide the following tools for debugging target-level and metric-level relabeli
|
||||||
which result to target drop.
|
which result to target drop.
|
||||||
|
|
||||||
- Metric-level debugging (e.g. `metric_relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs)
|
- Metric-level debugging (e.g. `metric_relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs)
|
||||||
and all the relabeling, which can be set up via `-relabelConfig`, `-remoteWrite.relabelConfig` and `-remoteWrite.urlRelabelConfig`
|
can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics)
|
||||||
command-line flags) can be performed by navigating to `http://vmagent:8429/metric-relabel-debug` page
|
and clicking the `debug metrics relabeling` link at the target, which must be debugged.
|
||||||
(`http://victoriametrics:8428/metric-relabel-debug` page for single-node VictoriaMetrics)
|
The opened page will show step-by-step results for the actual metric relabeling rules applied to the given target labels.
|
||||||
and submitting there relabeling rules together with the metric to be relabeled.
|
|
||||||
The page will show step-by-step results for the entered relabeling rules executed against the entered metric.
|
|
||||||
|
|
||||||
## Prometheus staleness markers
|
## Prometheus staleness markers
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
|
||||||
## tip
|
## tip
|
||||||
|
|
||||||
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add support for aggregation of incoming [samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) by time and by labels. See [these docs](https://docs.victoriametrics.com/stream-aggregation.html) and [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3460).
|
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): add support for aggregation of incoming [samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) by time and by labels. See [these docs](https://docs.victoriametrics.com/stream-aggregation.html) and [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3460).
|
||||||
|
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): automatically pre-fetch `metric_relabel_configs` and the target labels when clicking on the `debug metrics relabeling` link at the `http://vmagent:8429/targets` page at the particular target. See [these docs](https://docs.victoriametrics.com/vmagent.html#relabel-debug).
|
||||||
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): add ability to explore metrics exported by a particular `job` / `instance`. See [these docs](https://docs.victoriametrics.com/#metrics-explorer) and [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3386).
|
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): add ability to explore metrics exported by a particular `job` / `instance`. See [these docs](https://docs.victoriametrics.com/#metrics-explorer) and [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3386).
|
||||||
* FEATURE: allow passing partial `RFC3339` date/time to `time`, `start` and `end` query args at [querying APIs](https://docs.victoriametrics.com/#prometheus-querying-api-usage) and [export APIs](https://docs.victoriametrics.com/#how-to-export-time-series). For example, `2022` is equivalent to `2022-01-01T00:00:00Z`, while `2022-01-30T14` is equivalent to `2022-01-30T14:00:00Z`. See [these docs](https://docs.victoriametrics.com/#timestamp-formats).
|
* FEATURE: allow passing partial `RFC3339` date/time to `time`, `start` and `end` query args at [querying APIs](https://docs.victoriametrics.com/#prometheus-querying-api-usage) and [export APIs](https://docs.victoriametrics.com/#how-to-export-time-series). For example, `2022` is equivalent to `2022-01-01T00:00:00Z`, while `2022-01-30T14` is equivalent to `2022-01-30T14:00:00Z`. See [these docs](https://docs.victoriametrics.com/#timestamp-formats).
|
||||||
* FEATURE: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): allow using unicode letters in identifiers. For example, `температура{город="Киев"}` is a valid MetricsQL expression now. Previously every non-ascii letters should be escaped with `\` char when used inside MetricsQL expression: `\т\е\м\п\е\р\а\т\у\р\а{\г\о\р\о\д="Киев"}`. Now both expressions are equivalent. Thanks to @hzwwww for the [pull request](https://github.com/VictoriaMetrics/metricsql/pull/7).
|
* FEATURE: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): allow using unicode letters in identifiers. For example, `температура{город="Киев"}` is a valid MetricsQL expression now. Previously every non-ascii letters should be escaped with `\` char when used inside MetricsQL expression: `\т\е\м\п\е\р\а\т\у\р\а{\г\о\р\о\д="Киев"}`. Now both expressions are equivalent. Thanks to @hzwwww for the [pull request](https://github.com/VictoriaMetrics/metricsql/pull/7).
|
||||||
|
|
|
@ -608,8 +608,8 @@ provide the following tools for debugging target-level and metric-level relabeli
|
||||||
|
|
||||||
- Target-level debugging (e.g. `relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs))
|
- Target-level debugging (e.g. `relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs))
|
||||||
can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics)
|
can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics)
|
||||||
and clicking the `debug` link at the target, which must be debugged.
|
and clicking the `debug target relabeling` link at the target, which must be debugged.
|
||||||
The opened page will show step-by-step results for the actual relabeling rules applied to the target labels.
|
The opened page will show step-by-step results for the actual target relabeling rules applied to the discovered target labels.
|
||||||
|
|
||||||
The `http://vmagent:8429/targets` page shows only active targets. If you need to understand why some target
|
The `http://vmagent:8429/targets` page shows only active targets. If you need to understand why some target
|
||||||
is dropped during the relabeling, then navigate to `http://vmagent:8428/service-discovery` page
|
is dropped during the relabeling, then navigate to `http://vmagent:8428/service-discovery` page
|
||||||
|
@ -618,11 +618,9 @@ provide the following tools for debugging target-level and metric-level relabeli
|
||||||
which result to target drop.
|
which result to target drop.
|
||||||
|
|
||||||
- Metric-level debugging (e.g. `metric_relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs)
|
- Metric-level debugging (e.g. `metric_relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs)
|
||||||
and all the relabeling, which can be set up via `-relabelConfig`, `-remoteWrite.relabelConfig` and `-remoteWrite.urlRelabelConfig`
|
can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics)
|
||||||
command-line flags) can be performed by navigating to `http://vmagent:8429/metric-relabel-debug` page
|
and clicking the `debug metrics relabeling` link at the target, which must be debugged.
|
||||||
(`http://victoriametrics:8428/metric-relabel-debug` page for single-node VictoriaMetrics)
|
The opened page will show step-by-step results for the actual metric relabeling rules applied to the given target labels.
|
||||||
and submitting there relabeling rules together with the metric to be relabeled.
|
|
||||||
The page will show step-by-step results for the entered relabeling rules executed against the entered metric.
|
|
||||||
|
|
||||||
## Prometheus staleness markers
|
## Prometheus staleness markers
|
||||||
|
|
||||||
|
|
|
@ -7,51 +7,39 @@ import (
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promutils"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WriteMetricRelabelDebug writes /metric-relabel-debug page to w with the given metric and relabelConfigs fields.
|
// WriteMetricRelabelDebug writes /metric-relabel-debug page to w with the corresponding args.
|
||||||
func WriteMetricRelabelDebug(w io.Writer, metric, relabelConfigs string) {
|
func WriteMetricRelabelDebug(w io.Writer, targetID, metric, relabelConfigs string, err error) {
|
||||||
if metric == "" {
|
writeRelabelDebug(w, false, targetID, metric, relabelConfigs, err)
|
||||||
metric = "{}"
|
|
||||||
}
|
|
||||||
labels, err := promutils.NewLabelsFromString(metric)
|
|
||||||
if err != nil {
|
|
||||||
err = fmt.Errorf("cannot parse metric: %s", err)
|
|
||||||
WriteMetricRelabelDebugSteps(w, nil, metric, relabelConfigs, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
pcs, err := ParseRelabelConfigsData([]byte(relabelConfigs))
|
|
||||||
if err != nil {
|
|
||||||
err = fmt.Errorf("cannot parse relabel configs: %s", err)
|
|
||||||
WriteMetricRelabelDebugSteps(w, nil, metric, relabelConfigs, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
dss := newDebugRelabelSteps(pcs, labels, false)
|
|
||||||
WriteMetricRelabelDebugSteps(w, dss, metric, relabelConfigs, nil)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteTargetRelabelDebug writes /target-relabel-debug page to w with the corresponding args.
|
// WriteTargetRelabelDebug writes /target-relabel-debug page to w with the corresponding args.
|
||||||
func WriteTargetRelabelDebug(w io.Writer, targetID, metric, relabelConfigs string, err error) {
|
func WriteTargetRelabelDebug(w io.Writer, targetID, metric, relabelConfigs string, err error) {
|
||||||
|
writeRelabelDebug(w, true, targetID, metric, relabelConfigs, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func writeRelabelDebug(w io.Writer, isTargetRelabel bool, targetID, metric, relabelConfigs string, err error) {
|
||||||
if metric == "" {
|
if metric == "" {
|
||||||
metric = "{}"
|
metric = "{}"
|
||||||
}
|
}
|
||||||
if targetID == "" {
|
if targetID == "" {
|
||||||
WriteTargetRelabelDebugSteps(w, targetID, nil, metric, relabelConfigs, err)
|
WriteRelabelDebugSteps(w, isTargetRelabel, targetID, nil, metric, relabelConfigs, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
labels, err := promutils.NewLabelsFromString(metric)
|
labels, err := promutils.NewLabelsFromString(metric)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("cannot parse metric: %s", err)
|
err = fmt.Errorf("cannot parse metric: %s", err)
|
||||||
WriteTargetRelabelDebugSteps(w, targetID, nil, metric, relabelConfigs, err)
|
WriteRelabelDebugSteps(w, isTargetRelabel, targetID, nil, metric, relabelConfigs, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
pcs, err := ParseRelabelConfigsData([]byte(relabelConfigs))
|
pcs, err := ParseRelabelConfigsData([]byte(relabelConfigs))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("cannot parse relabel configs: %s", err)
|
err = fmt.Errorf("cannot parse relabel configs: %s", err)
|
||||||
WriteTargetRelabelDebugSteps(w, targetID, nil, metric, relabelConfigs, err)
|
WriteRelabelDebugSteps(w, isTargetRelabel, targetID, nil, metric, relabelConfigs, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dss := newDebugRelabelSteps(pcs, labels, true)
|
|
||||||
WriteTargetRelabelDebugSteps(w, targetID, dss, metric, relabelConfigs, nil)
|
dss := newDebugRelabelSteps(pcs, labels, isTargetRelabel)
|
||||||
|
WriteRelabelDebugSteps(w, isTargetRelabel, targetID, dss, metric, relabelConfigs, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func newDebugRelabelSteps(pcs *ParsedConfigs, labels *promutils.Labels, isTargetRelabel bool) []DebugStep {
|
func newDebugRelabelSteps(pcs *ParsedConfigs, labels *promutils.Labels, isTargetRelabel bool) []DebugStep {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
{% stripspace %}
|
{% stripspace %}
|
||||||
|
|
||||||
{% func MetricRelabelDebugSteps(dss []DebugStep, metric, relabelConfigs string, err error) %}
|
{% func RelabelDebugSteps(isTargetRelabel bool, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -16,7 +16,13 @@
|
||||||
{%= htmlcomponents.Navbar() %}
|
{%= htmlcomponents.Navbar() %}
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a href="https://docs.victoriametrics.com/relabeling.html" target="_blank">Relabeling docs</a>{% space %}
|
<a href="https://docs.victoriametrics.com/relabeling.html" target="_blank">Relabeling docs</a>{% space %}
|
||||||
<a href="target-relabel-debug">Target relabel debug</a>
|
|
||||||
|
{% if isTargetRelabel %}
|
||||||
|
<a href="metric-relabel-debug?id={%s targetID %}">Metric relabel debug</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="target-relabel-debug?id={%s targetID %}">Target relabel debug</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
{% if err != nil %}
|
{% if err != nil %}
|
||||||
{%= htmlcomponents.ErrorNotification(err) %}
|
{%= htmlcomponents.ErrorNotification(err) %}
|
||||||
|
@ -25,54 +31,17 @@
|
||||||
<div class="m-3">
|
<div class="m-3">
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
{%= relabelDebugFormInputs(metric, relabelConfigs) %}
|
{%= relabelDebugFormInputs(metric, relabelConfigs) %}
|
||||||
|
|
||||||
<input type="submit" value="Submit" class="btn btn-primary m-1" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<main class="col-12">
|
|
||||||
{%= relabelDebugSteps(dss) %}
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
{% endfunc %}
|
|
||||||
|
|
||||||
{% func TargetRelabelDebugSteps(targetID string, dss []DebugStep, metric, relabelConfigs string, err error) %}
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
{%= htmlcomponents.CommonHeader() %}
|
|
||||||
<title>Target relabel debug</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
{%= htmlcomponents.Navbar() %}
|
|
||||||
<div class="container-fluid">
|
|
||||||
<a href="https://docs.victoriametrics.com/relabeling.html" target="_blank">Relabeling docs</a>{% space %}
|
|
||||||
<a href="metric-relabel-debug">Metric relabel debug</a>
|
|
||||||
<br/>
|
|
||||||
{% if err != nil %}
|
|
||||||
{%= htmlcomponents.ErrorNotification(err) %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="m-3">
|
|
||||||
<form method="POST">
|
|
||||||
{%= relabelDebugFormInputs(metric, relabelConfigs) %}
|
|
||||||
|
|
||||||
<input type="hidden" name="id" value="{%s targetID %}" />
|
<input type="hidden" name="id" value="{%s targetID %}" />
|
||||||
|
|
||||||
<input type="submit" value="Submit" class="btn btn-primary m-1" />
|
<input type="submit" value="Submit" class="btn btn-primary m-1" />
|
||||||
{% if targetID != "" %}
|
{% if targetID != "" %}
|
||||||
<button type="button" onclick="location.href='target-relabel-debug?id={%s targetID %}'" class="btn btn-secondary m-1">Reset</button>
|
<button type="button" onclick="location.href='?id={%s targetID %}'" class="btn btn-secondary m-1">Reset</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<main class="col-12">
|
<main class="col-12">
|
||||||
{%= relabelDebugSteps(dss) %}
|
{%= relabelDebugSteps(dss) %}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,7 +24,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:8
|
//line lib/promrelabel/debug.qtpl:8
|
||||||
func StreamMetricRelabelDebugSteps(qw422016 *qt422016.Writer, dss []DebugStep, metric, relabelConfigs string, err error) {
|
func StreamRelabelDebugSteps(qw422016 *qt422016.Writer, isTargetRelabel bool, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
||||||
//line lib/promrelabel/debug.qtpl:8
|
//line lib/promrelabel/debug.qtpl:8
|
||||||
qw422016.N().S(`<!DOCTYPE html><html lang="en"><head>`)
|
qw422016.N().S(`<!DOCTYPE html><html lang="en"><head>`)
|
||||||
//line lib/promrelabel/debug.qtpl:12
|
//line lib/promrelabel/debug.qtpl:12
|
||||||
|
@ -37,256 +37,213 @@ func StreamMetricRelabelDebugSteps(qw422016 *qt422016.Writer, dss []DebugStep, m
|
||||||
qw422016.N().S(`<div class="container-fluid"><a href="https://docs.victoriametrics.com/relabeling.html" target="_blank">Relabeling docs</a>`)
|
qw422016.N().S(`<div class="container-fluid"><a href="https://docs.victoriametrics.com/relabeling.html" target="_blank">Relabeling docs</a>`)
|
||||||
//line lib/promrelabel/debug.qtpl:18
|
//line lib/promrelabel/debug.qtpl:18
|
||||||
qw422016.N().S(` `)
|
qw422016.N().S(` `)
|
||||||
//line lib/promrelabel/debug.qtpl:18
|
//line lib/promrelabel/debug.qtpl:20
|
||||||
qw422016.N().S(`<a href="target-relabel-debug">Target relabel debug</a><br>`)
|
if isTargetRelabel {
|
||||||
|
//line lib/promrelabel/debug.qtpl:20
|
||||||
|
qw422016.N().S(`<a href="metric-relabel-debug?id=`)
|
||||||
//line lib/promrelabel/debug.qtpl:21
|
//line lib/promrelabel/debug.qtpl:21
|
||||||
if err != nil {
|
|
||||||
//line lib/promrelabel/debug.qtpl:22
|
|
||||||
htmlcomponents.StreamErrorNotification(qw422016, err)
|
|
||||||
//line lib/promrelabel/debug.qtpl:23
|
|
||||||
}
|
|
||||||
//line lib/promrelabel/debug.qtpl:23
|
|
||||||
qw422016.N().S(`<div class="m-3"><form method="POST">`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:27
|
|
||||||
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
|
||||||
//line lib/promrelabel/debug.qtpl:27
|
|
||||||
qw422016.N().S(`<input type="submit" value="Submit" class="btn btn-primary m-1" /></form></div><div class="row"><main class="col-12">`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:35
|
|
||||||
streamrelabelDebugSteps(qw422016, dss)
|
|
||||||
//line lib/promrelabel/debug.qtpl:35
|
|
||||||
qw422016.N().S(`</main></div></div></body></html>`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
}
|
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
func WriteMetricRelabelDebugSteps(qq422016 qtio422016.Writer, dss []DebugStep, metric, relabelConfigs string, err error) {
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
StreamMetricRelabelDebugSteps(qw422016, dss, metric, relabelConfigs, err)
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
qt422016.ReleaseWriter(qw422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
}
|
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
func MetricRelabelDebugSteps(dss []DebugStep, metric, relabelConfigs string, err error) string {
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
WriteMetricRelabelDebugSteps(qb422016, dss, metric, relabelConfigs, err)
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
qs422016 := string(qb422016.B)
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
return qs422016
|
|
||||||
//line lib/promrelabel/debug.qtpl:41
|
|
||||||
}
|
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:43
|
|
||||||
func StreamTargetRelabelDebugSteps(qw422016 *qt422016.Writer, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
|
||||||
//line lib/promrelabel/debug.qtpl:43
|
|
||||||
qw422016.N().S(`<!DOCTYPE html><html lang="en"><head>`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:47
|
|
||||||
htmlcomponents.StreamCommonHeader(qw422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:47
|
|
||||||
qw422016.N().S(`<title>Target relabel debug</title></head><body>`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:51
|
|
||||||
htmlcomponents.StreamNavbar(qw422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:51
|
|
||||||
qw422016.N().S(`<div class="container-fluid"><a href="https://docs.victoriametrics.com/relabeling.html" target="_blank">Relabeling docs</a>`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:53
|
|
||||||
qw422016.N().S(` `)
|
|
||||||
//line lib/promrelabel/debug.qtpl:53
|
|
||||||
qw422016.N().S(`<a href="metric-relabel-debug">Metric relabel debug</a><br/>`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:56
|
|
||||||
if err != nil {
|
|
||||||
//line lib/promrelabel/debug.qtpl:57
|
|
||||||
htmlcomponents.StreamErrorNotification(qw422016, err)
|
|
||||||
//line lib/promrelabel/debug.qtpl:58
|
|
||||||
}
|
|
||||||
//line lib/promrelabel/debug.qtpl:58
|
|
||||||
qw422016.N().S(`<div class="m-3"><form method="POST">`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:62
|
|
||||||
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
|
||||||
//line lib/promrelabel/debug.qtpl:62
|
|
||||||
qw422016.N().S(`<input type="hidden" name="id" value="`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:64
|
|
||||||
qw422016.E().S(targetID)
|
|
||||||
//line lib/promrelabel/debug.qtpl:64
|
|
||||||
qw422016.N().S(`" /><input type="submit" value="Submit" class="btn btn-primary m-1" />`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:67
|
|
||||||
if targetID != "" {
|
|
||||||
//line lib/promrelabel/debug.qtpl:67
|
|
||||||
qw422016.N().S(`<button type="button" onclick="location.href='target-relabel-debug?id=`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:68
|
|
||||||
qw422016.E().S(targetID)
|
qw422016.E().S(targetID)
|
||||||
//line lib/promrelabel/debug.qtpl:68
|
//line lib/promrelabel/debug.qtpl:21
|
||||||
qw422016.N().S(`'" class="btn btn-secondary m-1">Reset</button>`)
|
qw422016.N().S(`">Metric relabel debug</a>`)
|
||||||
//line lib/promrelabel/debug.qtpl:69
|
//line lib/promrelabel/debug.qtpl:22
|
||||||
|
} else {
|
||||||
|
//line lib/promrelabel/debug.qtpl:22
|
||||||
|
qw422016.N().S(`<a href="target-relabel-debug?id=`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:23
|
||||||
|
qw422016.E().S(targetID)
|
||||||
|
//line lib/promrelabel/debug.qtpl:23
|
||||||
|
qw422016.N().S(`">Target relabel debug</a>`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:24
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:69
|
//line lib/promrelabel/debug.qtpl:24
|
||||||
qw422016.N().S(`</form></div><div class="row"><main class="col-12">`)
|
qw422016.N().S(`<br>`)
|
||||||
//line lib/promrelabel/debug.qtpl:75
|
//line lib/promrelabel/debug.qtpl:27
|
||||||
streamrelabelDebugSteps(qw422016, dss)
|
if err != nil {
|
||||||
//line lib/promrelabel/debug.qtpl:75
|
//line lib/promrelabel/debug.qtpl:28
|
||||||
qw422016.N().S(`</main></div></div></body></html>`)
|
htmlcomponents.StreamErrorNotification(qw422016, err)
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
//line lib/promrelabel/debug.qtpl:29
|
||||||
}
|
}
|
||||||
|
//line lib/promrelabel/debug.qtpl:29
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
qw422016.N().S(`<div class="m-3"><form method="POST">`)
|
||||||
func WriteTargetRelabelDebugSteps(qq422016 qtio422016.Writer, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
//line lib/promrelabel/debug.qtpl:33
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
StreamTargetRelabelDebugSteps(qw422016, targetID, dss, metric, relabelConfigs, err)
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
qt422016.ReleaseWriter(qw422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
}
|
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
func TargetRelabelDebugSteps(targetID string, dss []DebugStep, metric, relabelConfigs string, err error) string {
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
WriteTargetRelabelDebugSteps(qb422016, targetID, dss, metric, relabelConfigs, err)
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
qs422016 := string(qb422016.B)
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
return qs422016
|
|
||||||
//line lib/promrelabel/debug.qtpl:81
|
|
||||||
}
|
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:83
|
|
||||||
func streamrelabelDebugFormInputs(qw422016 *qt422016.Writer, metric, relabelConfigs string) {
|
|
||||||
//line lib/promrelabel/debug.qtpl:83
|
|
||||||
qw422016.N().S(`<div>Relabel configs:<br/><textarea name="relabel_configs" style="width: 100%; height: 15em" class="m-1">`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:86
|
|
||||||
qw422016.E().S(relabelConfigs)
|
|
||||||
//line lib/promrelabel/debug.qtpl:86
|
|
||||||
qw422016.N().S(`</textarea></div><div>Labels:<br/><textarea name="metric" style="width: 100%; height: 5em" class="m-1">`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:91
|
|
||||||
qw422016.E().S(metric)
|
|
||||||
//line lib/promrelabel/debug.qtpl:91
|
|
||||||
qw422016.N().S(`</textarea></div>`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
|
||||||
}
|
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
|
||||||
func writerelabelDebugFormInputs(qq422016 qtio422016.Writer, metric, relabelConfigs string) {
|
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
|
||||||
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
//line lib/promrelabel/debug.qtpl:33
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qw422016.N().S(`<input type="hidden" name="id" value="`)
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
//line lib/promrelabel/debug.qtpl:34
|
||||||
}
|
qw422016.E().S(targetID)
|
||||||
|
//line lib/promrelabel/debug.qtpl:34
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
qw422016.N().S(`" /><input type="submit" value="Submit" class="btn btn-primary m-1" />`)
|
||||||
func relabelDebugFormInputs(metric, relabelConfigs string) string {
|
//line lib/promrelabel/debug.qtpl:36
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
if targetID != "" {
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
//line lib/promrelabel/debug.qtpl:36
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
qw422016.N().S(`<button type="button" onclick="location.href='?id=`)
|
||||||
writerelabelDebugFormInputs(qb422016, metric, relabelConfigs)
|
//line lib/promrelabel/debug.qtpl:37
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
qw422016.E().S(targetID)
|
||||||
qs422016 := string(qb422016.B)
|
//line lib/promrelabel/debug.qtpl:37
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
qw422016.N().S(`'" class="btn btn-secondary m-1">Reset</button>`)
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
//line lib/promrelabel/debug.qtpl:38
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
|
||||||
return qs422016
|
|
||||||
//line lib/promrelabel/debug.qtpl:93
|
|
||||||
}
|
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:95
|
|
||||||
func streamrelabelDebugSteps(qw422016 *qt422016.Writer, dss []DebugStep) {
|
|
||||||
//line lib/promrelabel/debug.qtpl:96
|
|
||||||
if len(dss) > 0 {
|
|
||||||
//line lib/promrelabel/debug.qtpl:96
|
|
||||||
qw422016.N().S(`<div class="m-3"><b>Original labels:</b> <samp>`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:98
|
|
||||||
streammustFormatLabels(qw422016, dss[0].In)
|
|
||||||
//line lib/promrelabel/debug.qtpl:98
|
|
||||||
qw422016.N().S(`</samp></div>`)
|
|
||||||
//line lib/promrelabel/debug.qtpl:100
|
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:100
|
//line lib/promrelabel/debug.qtpl:38
|
||||||
|
qw422016.N().S(`</form></div><div class="row"><main class="col-12">`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:44
|
||||||
|
streamrelabelDebugSteps(qw422016, dss)
|
||||||
|
//line lib/promrelabel/debug.qtpl:44
|
||||||
|
qw422016.N().S(`</main></div></div></body></html>`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
}
|
||||||
|
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
func WriteRelabelDebugSteps(qq422016 qtio422016.Writer, isTargetRelabel bool, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
StreamRelabelDebugSteps(qw422016, isTargetRelabel, targetID, dss, metric, relabelConfigs, err)
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
qt422016.ReleaseWriter(qw422016)
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
}
|
||||||
|
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
func RelabelDebugSteps(isTargetRelabel bool, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) string {
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
WriteRelabelDebugSteps(qb422016, isTargetRelabel, targetID, dss, metric, relabelConfigs, err)
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
qs422016 := string(qb422016.B)
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
return qs422016
|
||||||
|
//line lib/promrelabel/debug.qtpl:50
|
||||||
|
}
|
||||||
|
|
||||||
|
//line lib/promrelabel/debug.qtpl:52
|
||||||
|
func streamrelabelDebugFormInputs(qw422016 *qt422016.Writer, metric, relabelConfigs string) {
|
||||||
|
//line lib/promrelabel/debug.qtpl:52
|
||||||
|
qw422016.N().S(`<div>Relabel configs:<br/><textarea name="relabel_configs" style="width: 100%; height: 15em" class="m-1">`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:55
|
||||||
|
qw422016.E().S(relabelConfigs)
|
||||||
|
//line lib/promrelabel/debug.qtpl:55
|
||||||
|
qw422016.N().S(`</textarea></div><div>Labels:<br/><textarea name="metric" style="width: 100%; height: 5em" class="m-1">`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:60
|
||||||
|
qw422016.E().S(metric)
|
||||||
|
//line lib/promrelabel/debug.qtpl:60
|
||||||
|
qw422016.N().S(`</textarea></div>`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
}
|
||||||
|
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
func writerelabelDebugFormInputs(qq422016 qtio422016.Writer, metric, relabelConfigs string) {
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
qt422016.ReleaseWriter(qw422016)
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
}
|
||||||
|
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
func relabelDebugFormInputs(metric, relabelConfigs string) string {
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
writerelabelDebugFormInputs(qb422016, metric, relabelConfigs)
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
qs422016 := string(qb422016.B)
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
return qs422016
|
||||||
|
//line lib/promrelabel/debug.qtpl:62
|
||||||
|
}
|
||||||
|
|
||||||
|
//line lib/promrelabel/debug.qtpl:64
|
||||||
|
func streamrelabelDebugSteps(qw422016 *qt422016.Writer, dss []DebugStep) {
|
||||||
|
//line lib/promrelabel/debug.qtpl:65
|
||||||
|
if len(dss) > 0 {
|
||||||
|
//line lib/promrelabel/debug.qtpl:65
|
||||||
|
qw422016.N().S(`<div class="m-3"><b>Original labels:</b> <samp>`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:67
|
||||||
|
streammustFormatLabels(qw422016, dss[0].In)
|
||||||
|
//line lib/promrelabel/debug.qtpl:67
|
||||||
|
qw422016.N().S(`</samp></div>`)
|
||||||
|
//line lib/promrelabel/debug.qtpl:69
|
||||||
|
}
|
||||||
|
//line lib/promrelabel/debug.qtpl:69
|
||||||
qw422016.N().S(`<table class="table table-striped table-hover table-bordered table-sm"><thead><tr><th scope="col" style="width: 5%">Step</th><th scope="col" style="width: 25%">Relabeling Rule</th><th scope="col" style="width: 35%">Input Labels</th><th scope="col" stile="width: 35%">Output labels</a></tr></thead><tbody>`)
|
qw422016.N().S(`<table class="table table-striped table-hover table-bordered table-sm"><thead><tr><th scope="col" style="width: 5%">Step</th><th scope="col" style="width: 25%">Relabeling Rule</th><th scope="col" style="width: 35%">Input Labels</th><th scope="col" stile="width: 35%">Output labels</a></tr></thead><tbody>`)
|
||||||
//line lib/promrelabel/debug.qtpl:111
|
//line lib/promrelabel/debug.qtpl:80
|
||||||
for i, ds := range dss {
|
for i, ds := range dss {
|
||||||
//line lib/promrelabel/debug.qtpl:113
|
//line lib/promrelabel/debug.qtpl:82
|
||||||
inLabels := promutils.MustNewLabelsFromString(ds.In)
|
inLabels := promutils.MustNewLabelsFromString(ds.In)
|
||||||
outLabels := promutils.MustNewLabelsFromString(ds.Out)
|
outLabels := promutils.MustNewLabelsFromString(ds.Out)
|
||||||
changedLabels := getChangedLabelNames(inLabels, outLabels)
|
changedLabels := getChangedLabelNames(inLabels, outLabels)
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:116
|
//line lib/promrelabel/debug.qtpl:85
|
||||||
qw422016.N().S(`<tr><td>`)
|
qw422016.N().S(`<tr><td>`)
|
||||||
//line lib/promrelabel/debug.qtpl:118
|
//line lib/promrelabel/debug.qtpl:87
|
||||||
qw422016.N().D(i)
|
qw422016.N().D(i)
|
||||||
//line lib/promrelabel/debug.qtpl:118
|
//line lib/promrelabel/debug.qtpl:87
|
||||||
qw422016.N().S(`</td><td><b><pre class="m-2">`)
|
qw422016.N().S(`</td><td><b><pre class="m-2">`)
|
||||||
//line lib/promrelabel/debug.qtpl:119
|
//line lib/promrelabel/debug.qtpl:88
|
||||||
qw422016.E().S(ds.Rule)
|
qw422016.E().S(ds.Rule)
|
||||||
//line lib/promrelabel/debug.qtpl:119
|
//line lib/promrelabel/debug.qtpl:88
|
||||||
qw422016.N().S(`</pre></b></td><td><div class="m-2" style="font-size: 0.9em" title="deleted and updated labels highlighted in red">`)
|
qw422016.N().S(`</pre></b></td><td><div class="m-2" style="font-size: 0.9em" title="deleted and updated labels highlighted in red">`)
|
||||||
//line lib/promrelabel/debug.qtpl:122
|
//line lib/promrelabel/debug.qtpl:91
|
||||||
streamlabelsWithHighlight(qw422016, inLabels, changedLabels, "red")
|
streamlabelsWithHighlight(qw422016, inLabels, changedLabels, "red")
|
||||||
//line lib/promrelabel/debug.qtpl:122
|
//line lib/promrelabel/debug.qtpl:91
|
||||||
qw422016.N().S(`</div></td><td><div class="m-2" style="font-size: 0.9em" title="added and updated labels highlighted in blue">`)
|
qw422016.N().S(`</div></td><td><div class="m-2" style="font-size: 0.9em" title="added and updated labels highlighted in blue">`)
|
||||||
//line lib/promrelabel/debug.qtpl:127
|
//line lib/promrelabel/debug.qtpl:96
|
||||||
streamlabelsWithHighlight(qw422016, outLabels, changedLabels, "blue")
|
streamlabelsWithHighlight(qw422016, outLabels, changedLabels, "blue")
|
||||||
//line lib/promrelabel/debug.qtpl:127
|
//line lib/promrelabel/debug.qtpl:96
|
||||||
qw422016.N().S(`</div></td></tr>`)
|
qw422016.N().S(`</div></td></tr>`)
|
||||||
//line lib/promrelabel/debug.qtpl:131
|
//line lib/promrelabel/debug.qtpl:100
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:131
|
//line lib/promrelabel/debug.qtpl:100
|
||||||
qw422016.N().S(`</tbody></table>`)
|
qw422016.N().S(`</tbody></table>`)
|
||||||
//line lib/promrelabel/debug.qtpl:134
|
//line lib/promrelabel/debug.qtpl:103
|
||||||
if len(dss) > 0 {
|
if len(dss) > 0 {
|
||||||
//line lib/promrelabel/debug.qtpl:134
|
//line lib/promrelabel/debug.qtpl:103
|
||||||
qw422016.N().S(`<div class="m-3"><b>Resulting labels:</b> <samp>`)
|
qw422016.N().S(`<div class="m-3"><b>Resulting labels:</b> <samp>`)
|
||||||
//line lib/promrelabel/debug.qtpl:136
|
//line lib/promrelabel/debug.qtpl:105
|
||||||
streammustFormatLabels(qw422016, dss[len(dss)-1].Out)
|
streammustFormatLabels(qw422016, dss[len(dss)-1].Out)
|
||||||
//line lib/promrelabel/debug.qtpl:136
|
//line lib/promrelabel/debug.qtpl:105
|
||||||
qw422016.N().S(`</samp></div>`)
|
qw422016.N().S(`</samp></div>`)
|
||||||
//line lib/promrelabel/debug.qtpl:138
|
//line lib/promrelabel/debug.qtpl:107
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []DebugStep) {
|
func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []DebugStep) {
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
streamrelabelDebugSteps(qw422016, dss)
|
streamrelabelDebugSteps(qw422016, dss)
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
func relabelDebugSteps(dss []DebugStep) string {
|
func relabelDebugSteps(dss []DebugStep) string {
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
writerelabelDebugSteps(qb422016, dss)
|
writerelabelDebugSteps(qb422016, dss)
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promrelabel/debug.qtpl:139
|
//line lib/promrelabel/debug.qtpl:108
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:141
|
//line lib/promrelabel/debug.qtpl:110
|
||||||
func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
|
func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
|
||||||
//line lib/promrelabel/debug.qtpl:143
|
//line lib/promrelabel/debug.qtpl:112
|
||||||
labelsList := labels.GetLabels()
|
labelsList := labels.GetLabels()
|
||||||
metricName := ""
|
metricName := ""
|
||||||
for i, label := range labelsList {
|
for i, label := range labelsList {
|
||||||
|
@ -297,137 +254,137 @@ func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:153
|
//line lib/promrelabel/debug.qtpl:122
|
||||||
if metricName != "" {
|
if metricName != "" {
|
||||||
//line lib/promrelabel/debug.qtpl:154
|
//line lib/promrelabel/debug.qtpl:123
|
||||||
if _, ok := highlight["__name__"]; ok {
|
if _, ok := highlight["__name__"]; ok {
|
||||||
//line lib/promrelabel/debug.qtpl:154
|
//line lib/promrelabel/debug.qtpl:123
|
||||||
qw422016.N().S(`<span style="font-weight:bold;color:`)
|
qw422016.N().S(`<span style="font-weight:bold;color:`)
|
||||||
//line lib/promrelabel/debug.qtpl:155
|
//line lib/promrelabel/debug.qtpl:124
|
||||||
qw422016.E().S(color)
|
qw422016.E().S(color)
|
||||||
//line lib/promrelabel/debug.qtpl:155
|
//line lib/promrelabel/debug.qtpl:124
|
||||||
qw422016.N().S(`">`)
|
qw422016.N().S(`">`)
|
||||||
//line lib/promrelabel/debug.qtpl:155
|
//line lib/promrelabel/debug.qtpl:124
|
||||||
qw422016.E().S(metricName)
|
qw422016.E().S(metricName)
|
||||||
//line lib/promrelabel/debug.qtpl:155
|
//line lib/promrelabel/debug.qtpl:124
|
||||||
qw422016.N().S(`</span>`)
|
qw422016.N().S(`</span>`)
|
||||||
//line lib/promrelabel/debug.qtpl:156
|
//line lib/promrelabel/debug.qtpl:125
|
||||||
} else {
|
} else {
|
||||||
//line lib/promrelabel/debug.qtpl:157
|
//line lib/promrelabel/debug.qtpl:126
|
||||||
qw422016.E().S(metricName)
|
qw422016.E().S(metricName)
|
||||||
//line lib/promrelabel/debug.qtpl:158
|
//line lib/promrelabel/debug.qtpl:127
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:159
|
//line lib/promrelabel/debug.qtpl:128
|
||||||
if len(labelsList) == 0 {
|
if len(labelsList) == 0 {
|
||||||
//line lib/promrelabel/debug.qtpl:159
|
//line lib/promrelabel/debug.qtpl:128
|
||||||
return
|
return
|
||||||
//line lib/promrelabel/debug.qtpl:159
|
//line lib/promrelabel/debug.qtpl:128
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:160
|
//line lib/promrelabel/debug.qtpl:129
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:160
|
//line lib/promrelabel/debug.qtpl:129
|
||||||
qw422016.N().S(`{`)
|
qw422016.N().S(`{`)
|
||||||
//line lib/promrelabel/debug.qtpl:162
|
//line lib/promrelabel/debug.qtpl:131
|
||||||
for i, label := range labelsList {
|
for i, label := range labelsList {
|
||||||
//line lib/promrelabel/debug.qtpl:163
|
//line lib/promrelabel/debug.qtpl:132
|
||||||
if _, ok := highlight[label.Name]; ok {
|
if _, ok := highlight[label.Name]; ok {
|
||||||
//line lib/promrelabel/debug.qtpl:163
|
//line lib/promrelabel/debug.qtpl:132
|
||||||
qw422016.N().S(`<span style="font-weight:bold;color:`)
|
qw422016.N().S(`<span style="font-weight:bold;color:`)
|
||||||
//line lib/promrelabel/debug.qtpl:164
|
//line lib/promrelabel/debug.qtpl:133
|
||||||
qw422016.E().S(color)
|
qw422016.E().S(color)
|
||||||
//line lib/promrelabel/debug.qtpl:164
|
//line lib/promrelabel/debug.qtpl:133
|
||||||
qw422016.N().S(`">`)
|
qw422016.N().S(`">`)
|
||||||
//line lib/promrelabel/debug.qtpl:164
|
//line lib/promrelabel/debug.qtpl:133
|
||||||
qw422016.E().S(label.Name)
|
qw422016.E().S(label.Name)
|
||||||
//line lib/promrelabel/debug.qtpl:164
|
//line lib/promrelabel/debug.qtpl:133
|
||||||
qw422016.N().S(`=`)
|
qw422016.N().S(`=`)
|
||||||
//line lib/promrelabel/debug.qtpl:164
|
//line lib/promrelabel/debug.qtpl:133
|
||||||
qw422016.E().Q(label.Value)
|
qw422016.E().Q(label.Value)
|
||||||
//line lib/promrelabel/debug.qtpl:164
|
//line lib/promrelabel/debug.qtpl:133
|
||||||
qw422016.N().S(`</span>`)
|
qw422016.N().S(`</span>`)
|
||||||
//line lib/promrelabel/debug.qtpl:165
|
//line lib/promrelabel/debug.qtpl:134
|
||||||
} else {
|
} else {
|
||||||
//line lib/promrelabel/debug.qtpl:166
|
//line lib/promrelabel/debug.qtpl:135
|
||||||
qw422016.E().S(label.Name)
|
qw422016.E().S(label.Name)
|
||||||
//line lib/promrelabel/debug.qtpl:166
|
//line lib/promrelabel/debug.qtpl:135
|
||||||
qw422016.N().S(`=`)
|
qw422016.N().S(`=`)
|
||||||
//line lib/promrelabel/debug.qtpl:166
|
//line lib/promrelabel/debug.qtpl:135
|
||||||
qw422016.E().Q(label.Value)
|
qw422016.E().Q(label.Value)
|
||||||
//line lib/promrelabel/debug.qtpl:167
|
//line lib/promrelabel/debug.qtpl:136
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:168
|
//line lib/promrelabel/debug.qtpl:137
|
||||||
if i < len(labelsList)-1 {
|
if i < len(labelsList)-1 {
|
||||||
//line lib/promrelabel/debug.qtpl:168
|
//line lib/promrelabel/debug.qtpl:137
|
||||||
qw422016.N().S(`,`)
|
qw422016.N().S(`,`)
|
||||||
//line lib/promrelabel/debug.qtpl:168
|
//line lib/promrelabel/debug.qtpl:137
|
||||||
qw422016.N().S(` `)
|
qw422016.N().S(` `)
|
||||||
//line lib/promrelabel/debug.qtpl:168
|
//line lib/promrelabel/debug.qtpl:137
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:169
|
//line lib/promrelabel/debug.qtpl:138
|
||||||
}
|
}
|
||||||
//line lib/promrelabel/debug.qtpl:169
|
//line lib/promrelabel/debug.qtpl:138
|
||||||
qw422016.N().S(`}`)
|
qw422016.N().S(`}`)
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
func writelabelsWithHighlight(qq422016 qtio422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
|
func writelabelsWithHighlight(qq422016 qtio422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
streamlabelsWithHighlight(qw422016, labels, highlight, color)
|
streamlabelsWithHighlight(qw422016, labels, highlight, color)
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
func labelsWithHighlight(labels *promutils.Labels, highlight map[string]struct{}, color string) string {
|
func labelsWithHighlight(labels *promutils.Labels, highlight map[string]struct{}, color string) string {
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
writelabelsWithHighlight(qb422016, labels, highlight, color)
|
writelabelsWithHighlight(qb422016, labels, highlight, color)
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promrelabel/debug.qtpl:171
|
//line lib/promrelabel/debug.qtpl:140
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:173
|
//line lib/promrelabel/debug.qtpl:142
|
||||||
func streammustFormatLabels(qw422016 *qt422016.Writer, s string) {
|
func streammustFormatLabels(qw422016 *qt422016.Writer, s string) {
|
||||||
//line lib/promrelabel/debug.qtpl:174
|
//line lib/promrelabel/debug.qtpl:143
|
||||||
labels := promutils.MustNewLabelsFromString(s)
|
labels := promutils.MustNewLabelsFromString(s)
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:175
|
//line lib/promrelabel/debug.qtpl:144
|
||||||
streamlabelsWithHighlight(qw422016, labels, nil, "")
|
streamlabelsWithHighlight(qw422016, labels, nil, "")
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
func writemustFormatLabels(qq422016 qtio422016.Writer, s string) {
|
func writemustFormatLabels(qq422016 qtio422016.Writer, s string) {
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
streammustFormatLabels(qw422016, s)
|
streammustFormatLabels(qw422016, s)
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
func mustFormatLabels(s string) string {
|
func mustFormatLabels(s string) string {
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
writemustFormatLabels(qb422016, s)
|
writemustFormatLabels(qb422016, s)
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promrelabel/debug.qtpl:176
|
//line lib/promrelabel/debug.qtpl:145
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,22 @@ import (
|
||||||
|
|
||||||
// WriteMetricRelabelDebug serves requests to /metric-relabel-debug page
|
// WriteMetricRelabelDebug serves requests to /metric-relabel-debug page
|
||||||
func WriteMetricRelabelDebug(w http.ResponseWriter, r *http.Request) {
|
func WriteMetricRelabelDebug(w http.ResponseWriter, r *http.Request) {
|
||||||
|
targetID := r.FormValue("id")
|
||||||
metric := r.FormValue("metric")
|
metric := r.FormValue("metric")
|
||||||
relabelConfigs := r.FormValue("relabel_configs")
|
relabelConfigs := r.FormValue("relabel_configs")
|
||||||
promrelabel.WriteMetricRelabelDebug(w, metric, relabelConfigs)
|
var err error
|
||||||
|
|
||||||
|
if metric == "" && relabelConfigs == "" {
|
||||||
|
pcs, labels, ok := getMetricRelabelContextByTargetID(targetID)
|
||||||
|
if !ok {
|
||||||
|
err = fmt.Errorf("cannot find target for id=%s", targetID)
|
||||||
|
targetID = ""
|
||||||
|
} else {
|
||||||
|
metric = labels.String()
|
||||||
|
relabelConfigs = pcs.String()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
promrelabel.WriteMetricRelabelDebug(w, targetID, metric, relabelConfigs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteTargetRelabelDebug generates response for /target-relabel-debug page
|
// WriteTargetRelabelDebug generates response for /target-relabel-debug page
|
||||||
|
@ -22,7 +35,7 @@ func WriteTargetRelabelDebug(w http.ResponseWriter, r *http.Request) {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
if metric == "" && relabelConfigs == "" {
|
if metric == "" && relabelConfigs == "" {
|
||||||
pcs, labels, ok := getRelabelContextByTargetID(targetID)
|
pcs, labels, ok := getTargetRelabelContextByTargetID(targetID)
|
||||||
if !ok {
|
if !ok {
|
||||||
err = fmt.Errorf("cannot find target for id=%s", targetID)
|
err = fmt.Errorf("cannot find target for id=%s", targetID)
|
||||||
targetID = ""
|
targetID = ""
|
||||||
|
|
|
@ -520,7 +520,20 @@ type targetLabelsByJob struct {
|
||||||
droppedTargets int
|
droppedTargets int
|
||||||
}
|
}
|
||||||
|
|
||||||
func getRelabelContextByTargetID(targetID string) (*promrelabel.ParsedConfigs, *promutils.Labels, bool) {
|
func getMetricRelabelContextByTargetID(targetID string) (*promrelabel.ParsedConfigs, *promutils.Labels, bool) {
|
||||||
|
tsmGlobal.mu.Lock()
|
||||||
|
defer tsmGlobal.mu.Unlock()
|
||||||
|
|
||||||
|
for sw := range tsmGlobal.m {
|
||||||
|
// The target is uniquely identified by a pointer to its original labels.
|
||||||
|
if getLabelsID(sw.Config.OriginalLabels) == targetID {
|
||||||
|
return sw.Config.MetricRelabelConfigs, sw.Config.Labels, true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil, nil, false
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTargetRelabelContextByTargetID(targetID string) (*promrelabel.ParsedConfigs, *promutils.Labels, bool) {
|
||||||
var relabelConfigs *promrelabel.ParsedConfigs
|
var relabelConfigs *promrelabel.ParsedConfigs
|
||||||
var labels *promutils.Labels
|
var labels *promutils.Labels
|
||||||
found := false
|
found := false
|
||||||
|
|
|
@ -250,7 +250,8 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="target-relabel-debug?id={%s targetID %}" target="_blank">debug</a>
|
<a href="target-relabel-debug?id={%s targetID %}" target="_blank">target</a>{% space %}
|
||||||
|
<a href="metric-relabel-debug?id={%s targetID %}" target="_blank">metrics</a>
|
||||||
</td>
|
</td>
|
||||||
<td>{%d ts.scrapesTotal %}</td>
|
<td>{%d ts.scrapesTotal %}</td>
|
||||||
<td>{%d ts.scrapesFailed %}</td>
|
<td>{%d ts.scrapesFailed %}</td>
|
||||||
|
|
|
@ -632,286 +632,294 @@ func streamscrapeJobTargets(qw422016 *qt422016.Writer, num int, jts *jobTargetsS
|
||||||
//line lib/promscrape/targetstatus.qtpl:253
|
//line lib/promscrape/targetstatus.qtpl:253
|
||||||
qw422016.E().S(targetID)
|
qw422016.E().S(targetID)
|
||||||
//line lib/promscrape/targetstatus.qtpl:253
|
//line lib/promscrape/targetstatus.qtpl:253
|
||||||
qw422016.N().S(`" target="_blank">debug</a></td><td>`)
|
qw422016.N().S(`" target="_blank">target</a>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:255
|
//line lib/promscrape/targetstatus.qtpl:253
|
||||||
|
qw422016.N().S(` `)
|
||||||
|
//line lib/promscrape/targetstatus.qtpl:253
|
||||||
|
qw422016.N().S(`<a href="metric-relabel-debug?id=`)
|
||||||
|
//line lib/promscrape/targetstatus.qtpl:254
|
||||||
|
qw422016.E().S(targetID)
|
||||||
|
//line lib/promscrape/targetstatus.qtpl:254
|
||||||
|
qw422016.N().S(`" target="_blank">metrics</a></td><td>`)
|
||||||
|
//line lib/promscrape/targetstatus.qtpl:256
|
||||||
qw422016.N().D(ts.scrapesTotal)
|
qw422016.N().D(ts.scrapesTotal)
|
||||||
//line lib/promscrape/targetstatus.qtpl:255
|
|
||||||
qw422016.N().S(`</td><td>`)
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:256
|
//line lib/promscrape/targetstatus.qtpl:256
|
||||||
|
qw422016.N().S(`</td><td>`)
|
||||||
|
//line lib/promscrape/targetstatus.qtpl:257
|
||||||
qw422016.N().D(ts.scrapesFailed)
|
qw422016.N().D(ts.scrapesFailed)
|
||||||
//line lib/promscrape/targetstatus.qtpl:256
|
//line lib/promscrape/targetstatus.qtpl:257
|
||||||
qw422016.N().S(`</td><td>`)
|
qw422016.N().S(`</td><td>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:258
|
//line lib/promscrape/targetstatus.qtpl:259
|
||||||
if lastScrapeDuration < 365*24*time.Hour {
|
if lastScrapeDuration < 365*24*time.Hour {
|
||||||
//line lib/promscrape/targetstatus.qtpl:259
|
//line lib/promscrape/targetstatus.qtpl:260
|
||||||
qw422016.N().D(int(lastScrapeDuration.Milliseconds()))
|
qw422016.N().D(int(lastScrapeDuration.Milliseconds()))
|
||||||
//line lib/promscrape/targetstatus.qtpl:259
|
//line lib/promscrape/targetstatus.qtpl:260
|
||||||
qw422016.N().S(`ms ago`)
|
qw422016.N().S(`ms ago`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:260
|
//line lib/promscrape/targetstatus.qtpl:261
|
||||||
} else {
|
} else {
|
||||||
//line lib/promscrape/targetstatus.qtpl:260
|
//line lib/promscrape/targetstatus.qtpl:261
|
||||||
qw422016.N().S(`none`)
|
qw422016.N().S(`none`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:262
|
//line lib/promscrape/targetstatus.qtpl:263
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:262
|
//line lib/promscrape/targetstatus.qtpl:263
|
||||||
qw422016.N().S(`<td>`)
|
qw422016.N().S(`<td>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:263
|
//line lib/promscrape/targetstatus.qtpl:264
|
||||||
qw422016.N().D(int(ts.scrapeDuration))
|
qw422016.N().D(int(ts.scrapeDuration))
|
||||||
//line lib/promscrape/targetstatus.qtpl:263
|
//line lib/promscrape/targetstatus.qtpl:264
|
||||||
qw422016.N().S(`ms</td><td>`)
|
qw422016.N().S(`ms</td><td>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:264
|
//line lib/promscrape/targetstatus.qtpl:265
|
||||||
qw422016.N().D(ts.samplesScraped)
|
qw422016.N().D(ts.samplesScraped)
|
||||||
//line lib/promscrape/targetstatus.qtpl:264
|
//line lib/promscrape/targetstatus.qtpl:265
|
||||||
qw422016.N().S(`</td><td>`)
|
qw422016.N().S(`</td><td>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:265
|
//line lib/promscrape/targetstatus.qtpl:266
|
||||||
if ts.err != nil {
|
if ts.err != nil {
|
||||||
//line lib/promscrape/targetstatus.qtpl:265
|
//line lib/promscrape/targetstatus.qtpl:266
|
||||||
qw422016.E().S(ts.err.Error())
|
qw422016.E().S(ts.err.Error())
|
||||||
//line lib/promscrape/targetstatus.qtpl:265
|
//line lib/promscrape/targetstatus.qtpl:266
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:265
|
//line lib/promscrape/targetstatus.qtpl:266
|
||||||
qw422016.N().S(`</td></tr>`)
|
qw422016.N().S(`</td></tr>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:267
|
//line lib/promscrape/targetstatus.qtpl:268
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:267
|
//line lib/promscrape/targetstatus.qtpl:268
|
||||||
qw422016.N().S(`</tbody></table></div></div></div>`)
|
qw422016.N().S(`</tbody></table></div></div></div>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
func writescrapeJobTargets(qq422016 qtio422016.Writer, num int, jts *jobTargetsStatuses) {
|
func writescrapeJobTargets(qq422016 qtio422016.Writer, num int, jts *jobTargetsStatuses) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
streamscrapeJobTargets(qw422016, num, jts)
|
streamscrapeJobTargets(qw422016, num, jts)
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
func scrapeJobTargets(num int, jts *jobTargetsStatuses) string {
|
func scrapeJobTargets(num int, jts *jobTargetsStatuses) string {
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
writescrapeJobTargets(qb422016, num, jts)
|
writescrapeJobTargets(qb422016, num, jts)
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promscrape/targetstatus.qtpl:273
|
//line lib/promscrape/targetstatus.qtpl:274
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:275
|
|
||||||
func streamdiscoveredTargets(qw422016 *qt422016.Writer, tsr *targetsStatusResult) {
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:276
|
//line lib/promscrape/targetstatus.qtpl:276
|
||||||
|
func streamdiscoveredTargets(qw422016 *qt422016.Writer, tsr *targetsStatusResult) {
|
||||||
|
//line lib/promscrape/targetstatus.qtpl:277
|
||||||
tljs := tsr.getTargetLabelsByJob()
|
tljs := tsr.getTargetLabelsByJob()
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:276
|
//line lib/promscrape/targetstatus.qtpl:277
|
||||||
qw422016.N().S(`<div class="row mt-4"><div class="col-12">`)
|
qw422016.N().S(`<div class="row mt-4"><div class="col-12">`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:279
|
|
||||||
for i, tlj := range tljs {
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:280
|
//line lib/promscrape/targetstatus.qtpl:280
|
||||||
|
for i, tlj := range tljs {
|
||||||
|
//line lib/promscrape/targetstatus.qtpl:281
|
||||||
streamdiscoveredJobTargets(qw422016, i, tlj)
|
streamdiscoveredJobTargets(qw422016, i, tlj)
|
||||||
//line lib/promscrape/targetstatus.qtpl:281
|
//line lib/promscrape/targetstatus.qtpl:282
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:281
|
//line lib/promscrape/targetstatus.qtpl:282
|
||||||
qw422016.N().S(`</div></div>`)
|
qw422016.N().S(`</div></div>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
func writediscoveredTargets(qq422016 qtio422016.Writer, tsr *targetsStatusResult) {
|
func writediscoveredTargets(qq422016 qtio422016.Writer, tsr *targetsStatusResult) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
streamdiscoveredTargets(qw422016, tsr)
|
streamdiscoveredTargets(qw422016, tsr)
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
func discoveredTargets(tsr *targetsStatusResult) string {
|
func discoveredTargets(tsr *targetsStatusResult) string {
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
writediscoveredTargets(qb422016, tsr)
|
writediscoveredTargets(qb422016, tsr)
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promscrape/targetstatus.qtpl:284
|
//line lib/promscrape/targetstatus.qtpl:285
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:286
|
//line lib/promscrape/targetstatus.qtpl:287
|
||||||
func streamdiscoveredJobTargets(qw422016 *qt422016.Writer, num int, tlj *targetLabelsByJob) {
|
func streamdiscoveredJobTargets(qw422016 *qt422016.Writer, num int, tlj *targetLabelsByJob) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:286
|
//line lib/promscrape/targetstatus.qtpl:287
|
||||||
qw422016.N().S(`<h4><span class="me-2">`)
|
qw422016.N().S(`<h4><span class="me-2">`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:288
|
//line lib/promscrape/targetstatus.qtpl:289
|
||||||
qw422016.E().S(tlj.jobName)
|
qw422016.E().S(tlj.jobName)
|
||||||
//line lib/promscrape/targetstatus.qtpl:288
|
//line lib/promscrape/targetstatus.qtpl:289
|
||||||
qw422016.N().S(` `)
|
qw422016.N().S(` `)
|
||||||
//line lib/promscrape/targetstatus.qtpl:288
|
//line lib/promscrape/targetstatus.qtpl:289
|
||||||
qw422016.N().S(`(`)
|
qw422016.N().S(`(`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:288
|
//line lib/promscrape/targetstatus.qtpl:289
|
||||||
qw422016.N().D(tlj.activeTargets)
|
qw422016.N().D(tlj.activeTargets)
|
||||||
//line lib/promscrape/targetstatus.qtpl:288
|
//line lib/promscrape/targetstatus.qtpl:289
|
||||||
qw422016.N().S(`/`)
|
qw422016.N().S(`/`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:288
|
//line lib/promscrape/targetstatus.qtpl:289
|
||||||
qw422016.N().D(tlj.activeTargets + tlj.droppedTargets)
|
qw422016.N().D(tlj.activeTargets + tlj.droppedTargets)
|
||||||
//line lib/promscrape/targetstatus.qtpl:288
|
//line lib/promscrape/targetstatus.qtpl:289
|
||||||
qw422016.N().S(` `)
|
qw422016.N().S(` `)
|
||||||
//line lib/promscrape/targetstatus.qtpl:288
|
//line lib/promscrape/targetstatus.qtpl:289
|
||||||
qw422016.N().S(`active)</span>`)
|
qw422016.N().S(`active)</span>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:289
|
//line lib/promscrape/targetstatus.qtpl:290
|
||||||
streamshowHideScrapeJobButtons(qw422016, num)
|
streamshowHideScrapeJobButtons(qw422016, num)
|
||||||
//line lib/promscrape/targetstatus.qtpl:289
|
//line lib/promscrape/targetstatus.qtpl:290
|
||||||
qw422016.N().S(`</h4><div id="scrape-job-`)
|
qw422016.N().S(`</h4><div id="scrape-job-`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:291
|
//line lib/promscrape/targetstatus.qtpl:292
|
||||||
qw422016.N().D(num)
|
qw422016.N().D(num)
|
||||||
//line lib/promscrape/targetstatus.qtpl:291
|
//line lib/promscrape/targetstatus.qtpl:292
|
||||||
qw422016.N().S(`" class="scrape-job table-responsive"><table class="table table-striped table-hover table-bordered table-sm"><thead><tr><th scope="col" style="width: 5%">Status</th><th scope="col" style="width: 60%">Discovered Labels</th><th scope="col" style="width: 30%">Target Labels</th><th scope="col" stile="width: 5%">Debug relabeling</a></tr></thead><tbody>`)
|
qw422016.N().S(`" class="scrape-job table-responsive"><table class="table table-striped table-hover table-bordered table-sm"><thead><tr><th scope="col" style="width: 5%">Status</th><th scope="col" style="width: 60%">Discovered Labels</th><th scope="col" style="width: 30%">Target Labels</th><th scope="col" stile="width: 5%">Debug relabeling</a></tr></thead><tbody>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:302
|
//line lib/promscrape/targetstatus.qtpl:303
|
||||||
for _, t := range tlj.targets {
|
for _, t := range tlj.targets {
|
||||||
//line lib/promscrape/targetstatus.qtpl:302
|
//line lib/promscrape/targetstatus.qtpl:303
|
||||||
qw422016.N().S(`<tr`)
|
qw422016.N().S(`<tr`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:304
|
//line lib/promscrape/targetstatus.qtpl:305
|
||||||
if !t.up {
|
if !t.up {
|
||||||
//line lib/promscrape/targetstatus.qtpl:305
|
//line lib/promscrape/targetstatus.qtpl:306
|
||||||
qw422016.N().S(` `)
|
qw422016.N().S(` `)
|
||||||
//line lib/promscrape/targetstatus.qtpl:305
|
//line lib/promscrape/targetstatus.qtpl:306
|
||||||
qw422016.N().S(`role="alert"`)
|
qw422016.N().S(`role="alert"`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:305
|
//line lib/promscrape/targetstatus.qtpl:306
|
||||||
qw422016.N().S(` `)
|
qw422016.N().S(` `)
|
||||||
//line lib/promscrape/targetstatus.qtpl:306
|
//line lib/promscrape/targetstatus.qtpl:307
|
||||||
if t.labels.Len() > 0 {
|
if t.labels.Len() > 0 {
|
||||||
//line lib/promscrape/targetstatus.qtpl:306
|
//line lib/promscrape/targetstatus.qtpl:307
|
||||||
qw422016.N().S(`class="alert alert-danger"`)
|
qw422016.N().S(`class="alert alert-danger"`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:308
|
//line lib/promscrape/targetstatus.qtpl:309
|
||||||
} else {
|
} else {
|
||||||
//line lib/promscrape/targetstatus.qtpl:308
|
//line lib/promscrape/targetstatus.qtpl:309
|
||||||
qw422016.N().S(`class="alert alert-warning"`)
|
qw422016.N().S(`class="alert alert-warning"`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:310
|
//line lib/promscrape/targetstatus.qtpl:311
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:311
|
//line lib/promscrape/targetstatus.qtpl:312
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:311
|
//line lib/promscrape/targetstatus.qtpl:312
|
||||||
qw422016.N().S(`><td>`)
|
qw422016.N().S(`><td>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:314
|
//line lib/promscrape/targetstatus.qtpl:315
|
||||||
if t.up {
|
if t.up {
|
||||||
//line lib/promscrape/targetstatus.qtpl:314
|
//line lib/promscrape/targetstatus.qtpl:315
|
||||||
qw422016.N().S(`<span class="badge bg-success">UP</span>`)
|
qw422016.N().S(`<span class="badge bg-success">UP</span>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:316
|
//line lib/promscrape/targetstatus.qtpl:317
|
||||||
} else if t.labels.Len() > 0 {
|
} else if t.labels.Len() > 0 {
|
||||||
//line lib/promscrape/targetstatus.qtpl:316
|
//line lib/promscrape/targetstatus.qtpl:317
|
||||||
qw422016.N().S(`<span class="badge bg-danger">DOWN</span>`)
|
qw422016.N().S(`<span class="badge bg-danger">DOWN</span>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:318
|
//line lib/promscrape/targetstatus.qtpl:319
|
||||||
} else {
|
} else {
|
||||||
//line lib/promscrape/targetstatus.qtpl:318
|
//line lib/promscrape/targetstatus.qtpl:319
|
||||||
qw422016.N().S(`<span class="badge bg-warning">DROPPED</span>`)
|
qw422016.N().S(`<span class="badge bg-warning">DROPPED</span>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:320
|
//line lib/promscrape/targetstatus.qtpl:321
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:320
|
//line lib/promscrape/targetstatus.qtpl:321
|
||||||
qw422016.N().S(`</td><td class="labels">`)
|
qw422016.N().S(`</td><td class="labels">`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:323
|
//line lib/promscrape/targetstatus.qtpl:324
|
||||||
streamformatLabels(qw422016, t.originalLabels)
|
streamformatLabels(qw422016, t.originalLabels)
|
||||||
//line lib/promscrape/targetstatus.qtpl:323
|
//line lib/promscrape/targetstatus.qtpl:324
|
||||||
qw422016.N().S(`</td><td class="labels">`)
|
qw422016.N().S(`</td><td class="labels">`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:326
|
//line lib/promscrape/targetstatus.qtpl:327
|
||||||
streamformatLabels(qw422016, t.labels)
|
streamformatLabels(qw422016, t.labels)
|
||||||
//line lib/promscrape/targetstatus.qtpl:326
|
//line lib/promscrape/targetstatus.qtpl:327
|
||||||
qw422016.N().S(`</td><td>`)
|
qw422016.N().S(`</td><td>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:329
|
//line lib/promscrape/targetstatus.qtpl:330
|
||||||
targetID := getLabelsID(t.originalLabels)
|
targetID := getLabelsID(t.originalLabels)
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:329
|
//line lib/promscrape/targetstatus.qtpl:330
|
||||||
qw422016.N().S(`<a href="target-relabel-debug?id=`)
|
qw422016.N().S(`<a href="target-relabel-debug?id=`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:330
|
//line lib/promscrape/targetstatus.qtpl:331
|
||||||
qw422016.E().S(targetID)
|
qw422016.E().S(targetID)
|
||||||
//line lib/promscrape/targetstatus.qtpl:330
|
//line lib/promscrape/targetstatus.qtpl:331
|
||||||
qw422016.N().S(`" target="_blank">debug</a></td></tr>`)
|
qw422016.N().S(`" target="_blank">debug</a></td></tr>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:333
|
//line lib/promscrape/targetstatus.qtpl:334
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:333
|
//line lib/promscrape/targetstatus.qtpl:334
|
||||||
qw422016.N().S(`</tbody></table></div>`)
|
qw422016.N().S(`</tbody></table></div>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
func writediscoveredJobTargets(qq422016 qtio422016.Writer, num int, tlj *targetLabelsByJob) {
|
func writediscoveredJobTargets(qq422016 qtio422016.Writer, num int, tlj *targetLabelsByJob) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
streamdiscoveredJobTargets(qw422016, num, tlj)
|
streamdiscoveredJobTargets(qw422016, num, tlj)
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
func discoveredJobTargets(num int, tlj *targetLabelsByJob) string {
|
func discoveredJobTargets(num int, tlj *targetLabelsByJob) string {
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
writediscoveredJobTargets(qb422016, num, tlj)
|
writediscoveredJobTargets(qb422016, num, tlj)
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promscrape/targetstatus.qtpl:337
|
//line lib/promscrape/targetstatus.qtpl:338
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:339
|
//line lib/promscrape/targetstatus.qtpl:340
|
||||||
func streamshowHideScrapeJobButtons(qw422016 *qt422016.Writer, num int) {
|
func streamshowHideScrapeJobButtons(qw422016 *qt422016.Writer, num int) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:339
|
//line lib/promscrape/targetstatus.qtpl:340
|
||||||
qw422016.N().S(`<button type="button" class="btn btn-primary btn-sm me-1"onclick="document.getElementById('scrape-job-`)
|
qw422016.N().S(`<button type="button" class="btn btn-primary btn-sm me-1"onclick="document.getElementById('scrape-job-`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:341
|
//line lib/promscrape/targetstatus.qtpl:342
|
||||||
qw422016.N().D(num)
|
qw422016.N().D(num)
|
||||||
//line lib/promscrape/targetstatus.qtpl:341
|
//line lib/promscrape/targetstatus.qtpl:342
|
||||||
qw422016.N().S(`').style.display='none'">collapse</button><button type="button" class="btn btn-secondary btn-sm me-1"onclick="document.getElementById('scrape-job-`)
|
qw422016.N().S(`').style.display='none'">collapse</button><button type="button" class="btn btn-secondary btn-sm me-1"onclick="document.getElementById('scrape-job-`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:345
|
//line lib/promscrape/targetstatus.qtpl:346
|
||||||
qw422016.N().D(num)
|
qw422016.N().D(num)
|
||||||
//line lib/promscrape/targetstatus.qtpl:345
|
//line lib/promscrape/targetstatus.qtpl:346
|
||||||
qw422016.N().S(`').style.display='block'">expand</button>`)
|
qw422016.N().S(`').style.display='block'">expand</button>`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
func writeshowHideScrapeJobButtons(qq422016 qtio422016.Writer, num int) {
|
func writeshowHideScrapeJobButtons(qq422016 qtio422016.Writer, num int) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
streamshowHideScrapeJobButtons(qw422016, num)
|
streamshowHideScrapeJobButtons(qw422016, num)
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
func showHideScrapeJobButtons(num int) string {
|
func showHideScrapeJobButtons(num int) string {
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
writeshowHideScrapeJobButtons(qb422016, num)
|
writeshowHideScrapeJobButtons(qb422016, num)
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promscrape/targetstatus.qtpl:348
|
//line lib/promscrape/targetstatus.qtpl:349
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:350
|
//line lib/promscrape/targetstatus.qtpl:351
|
||||||
func streamqueryArgs(qw422016 *qt422016.Writer, filter *requestFilter, override map[string]string) {
|
func streamqueryArgs(qw422016 *qt422016.Writer, filter *requestFilter, override map[string]string) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:352
|
//line lib/promscrape/targetstatus.qtpl:353
|
||||||
showOnlyUnhealthy := "false"
|
showOnlyUnhealthy := "false"
|
||||||
if filter.showOnlyUnhealthy {
|
if filter.showOnlyUnhealthy {
|
||||||
showOnlyUnhealthy = "true"
|
showOnlyUnhealthy = "true"
|
||||||
|
@ -929,89 +937,89 @@ func streamqueryArgs(qw422016 *qt422016.Writer, filter *requestFilter, override
|
||||||
qa[k] = []string{v}
|
qa[k] = []string{v}
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:369
|
//line lib/promscrape/targetstatus.qtpl:370
|
||||||
qw422016.E().S(qa.Encode())
|
qw422016.E().S(qa.Encode())
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
func writequeryArgs(qq422016 qtio422016.Writer, filter *requestFilter, override map[string]string) {
|
func writequeryArgs(qq422016 qtio422016.Writer, filter *requestFilter, override map[string]string) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
streamqueryArgs(qw422016, filter, override)
|
streamqueryArgs(qw422016, filter, override)
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
func queryArgs(filter *requestFilter, override map[string]string) string {
|
func queryArgs(filter *requestFilter, override map[string]string) string {
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
writequeryArgs(qb422016, filter, override)
|
writequeryArgs(qb422016, filter, override)
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promscrape/targetstatus.qtpl:370
|
//line lib/promscrape/targetstatus.qtpl:371
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:372
|
|
||||||
func streamformatLabels(qw422016 *qt422016.Writer, labels *promutils.Labels) {
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:373
|
//line lib/promscrape/targetstatus.qtpl:373
|
||||||
|
func streamformatLabels(qw422016 *qt422016.Writer, labels *promutils.Labels) {
|
||||||
|
//line lib/promscrape/targetstatus.qtpl:374
|
||||||
labelsList := labels.GetLabels()
|
labelsList := labels.GetLabels()
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:373
|
//line lib/promscrape/targetstatus.qtpl:374
|
||||||
qw422016.N().S(`{`)
|
qw422016.N().S(`{`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:375
|
//line lib/promscrape/targetstatus.qtpl:376
|
||||||
for i, label := range labelsList {
|
for i, label := range labelsList {
|
||||||
//line lib/promscrape/targetstatus.qtpl:376
|
//line lib/promscrape/targetstatus.qtpl:377
|
||||||
qw422016.E().S(label.Name)
|
qw422016.E().S(label.Name)
|
||||||
//line lib/promscrape/targetstatus.qtpl:376
|
//line lib/promscrape/targetstatus.qtpl:377
|
||||||
qw422016.N().S(`=`)
|
qw422016.N().S(`=`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:376
|
//line lib/promscrape/targetstatus.qtpl:377
|
||||||
qw422016.E().Q(label.Value)
|
qw422016.E().Q(label.Value)
|
||||||
//line lib/promscrape/targetstatus.qtpl:377
|
//line lib/promscrape/targetstatus.qtpl:378
|
||||||
if i+1 < len(labelsList) {
|
if i+1 < len(labelsList) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:377
|
//line lib/promscrape/targetstatus.qtpl:378
|
||||||
qw422016.N().S(`,`)
|
qw422016.N().S(`,`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:377
|
//line lib/promscrape/targetstatus.qtpl:378
|
||||||
qw422016.N().S(` `)
|
qw422016.N().S(` `)
|
||||||
//line lib/promscrape/targetstatus.qtpl:377
|
//line lib/promscrape/targetstatus.qtpl:378
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:378
|
//line lib/promscrape/targetstatus.qtpl:379
|
||||||
}
|
}
|
||||||
//line lib/promscrape/targetstatus.qtpl:378
|
//line lib/promscrape/targetstatus.qtpl:379
|
||||||
qw422016.N().S(`}`)
|
qw422016.N().S(`}`)
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
func writeformatLabels(qq422016 qtio422016.Writer, labels *promutils.Labels) {
|
func writeformatLabels(qq422016 qtio422016.Writer, labels *promutils.Labels) {
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
streamformatLabels(qw422016, labels)
|
streamformatLabels(qw422016, labels)
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
}
|
}
|
||||||
|
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
func formatLabels(labels *promutils.Labels) string {
|
func formatLabels(labels *promutils.Labels) string {
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
writeformatLabels(qb422016, labels)
|
writeformatLabels(qb422016, labels)
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
return qs422016
|
return qs422016
|
||||||
//line lib/promscrape/targetstatus.qtpl:380
|
//line lib/promscrape/targetstatus.qtpl:381
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue