2022-12-10 11:09:21 +01:00
|
|
|
// Code generated by qtc from "relabel_debug.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:1
|
|
|
|
package promscrape
|
|
|
|
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:1
|
|
|
|
import (
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promrelabel"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promutils"
|
|
|
|
)
|
|
|
|
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:8
|
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:8
|
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:8
|
|
|
|
func StreamMetricRelabelDebugSteps(qw422016 *qt422016.Writer, dss []promrelabel.DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:8
|
|
|
|
qw422016.N().S(`<!DOCTYPE html><html lang="en"><head>`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:12
|
|
|
|
streamcommonHeader(qw422016)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:12
|
|
|
|
qw422016.N().S(`<title>Metric relabel debug</title></head><body>`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:16
|
|
|
|
streamnavbar(qw422016)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:16
|
2022-12-10 21:44:09 +01:00
|
|
|
qw422016.N().S(`<div class="container-fluid"><a href="https://docs.victoriametrics.com/relabeling.html" target="_blank">Relabeling docs</a>`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:18
|
|
|
|
qw422016.N().S(` `)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:18
|
|
|
|
qw422016.N().S(`<a href="target-relabel-debug">Target relabel debug</a><br>`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:21
|
2022-12-10 11:09:21 +01:00
|
|
|
if err != nil {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:22
|
2022-12-10 11:09:21 +01:00
|
|
|
streamerrorNotification(qw422016, err)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:23
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:23
|
|
|
|
qw422016.N().S(`<div class="m-3"><form method="POST">`)
|
2022-12-10 11:09:21 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:27
|
2022-12-10 21:44:09 +01:00
|
|
|
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
2022-12-10 11:09:21 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:27
|
2022-12-10 21:44:09 +01:00
|
|
|
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/promscrape/relabel_debug.qtpl:35
|
2022-12-10 11:09:21 +01:00
|
|
|
streamrelabelDebugSteps(qw422016, dss)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:35
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</main></div></div></body></html>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
func WriteMetricRelabelDebugSteps(qq422016 qtio422016.Writer, dss []promrelabel.DebugStep, metric, relabelConfigs string, err error) {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
StreamMetricRelabelDebugSteps(qw422016, dss, metric, relabelConfigs, err)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
func MetricRelabelDebugSteps(dss []promrelabel.DebugStep, metric, relabelConfigs string, err error) string {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
WriteMetricRelabelDebugSteps(qb422016, dss, metric, relabelConfigs, err)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
return qs422016
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:41
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:43
|
|
|
|
func StreamTargetRelabelDebugSteps(qw422016 *qt422016.Writer, targetID string, dss []promrelabel.DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:43
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`<!DOCTYPE html><html lang="en"><head>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:47
|
2022-12-10 11:09:21 +01:00
|
|
|
streamcommonHeader(qw422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:47
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`<title>Target relabel debug</title></head><body>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:51
|
2022-12-10 11:09:21 +01:00
|
|
|
streamnavbar(qw422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_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/promscrape/relabel_debug.qtpl:53
|
|
|
|
qw422016.N().S(` `)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:53
|
|
|
|
qw422016.N().S(`<a href="metric-relabel-debug">Metric relabel debug</a><br/>`)
|
2022-12-10 11:09:21 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:56
|
2022-12-10 21:44:09 +01:00
|
|
|
if err != nil {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:57
|
|
|
|
streamerrorNotification(qw422016, err)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:58
|
|
|
|
}
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:58
|
|
|
|
qw422016.N().S(`<div class="m-3"><form method="POST">`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:62
|
|
|
|
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:62
|
|
|
|
qw422016.N().S(`<input type="hidden" name="id" value="`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:64
|
|
|
|
qw422016.E().S(targetID)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:64
|
|
|
|
qw422016.N().S(`" /><input type="submit" value="Submit" class="btn btn-primary m-1" />`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:67
|
|
|
|
if targetID != "" {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:67
|
|
|
|
qw422016.N().S(`<button type="button" onclick="location.href='target-relabel-debug?id=`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:68
|
|
|
|
qw422016.E().S(targetID)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:68
|
|
|
|
qw422016.N().S(`'" class="btn btn-secondary m-1">Reset</button>`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:69
|
|
|
|
}
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:69
|
|
|
|
qw422016.N().S(`</form></div><div class="row"><main class="col-12">`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:75
|
2022-12-10 11:09:21 +01:00
|
|
|
streamrelabelDebugSteps(qw422016, dss)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:75
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</main></div></div></body></html>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
|
|
|
func WriteTargetRelabelDebugSteps(qq422016 qtio422016.Writer, targetID string, dss []promrelabel.DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
|
|
|
StreamTargetRelabelDebugSteps(qw422016, targetID, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
|
|
|
func TargetRelabelDebugSteps(targetID string, dss []promrelabel.DebugStep, metric, relabelConfigs string, err error) string {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
|
|
|
WriteTargetRelabelDebugSteps(qb422016, targetID, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
return qs422016
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:81
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:83
|
|
|
|
func streamrelabelDebugFormInputs(qw422016 *qt422016.Writer, metric, relabelConfigs string) {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:83
|
|
|
|
qw422016.N().S(`<div>Relabel configs:<br/><textarea name="relabel_configs" style="width: 100%; height: 15em" class="m-1">`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:86
|
|
|
|
qw422016.E().S(relabelConfigs)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:86
|
|
|
|
qw422016.N().S(`</textarea></div><div>Labels:<br/><textarea name="metric" style="width: 100%; height: 5em" class="m-1">`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:91
|
|
|
|
qw422016.E().S(metric)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:91
|
|
|
|
qw422016.N().S(`</textarea></div>`)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
func writerelabelDebugFormInputs(qq422016 qtio422016.Writer, metric, relabelConfigs string) {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
qt422016.ReleaseWriter(qw422016)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
func relabelDebugFormInputs(metric, relabelConfigs string) string {
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
writerelabelDebugFormInputs(qb422016, metric, relabelConfigs)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
qs422016 := string(qb422016.B)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
return qs422016
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:93
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promscrape/relabel_debug.qtpl:95
|
2022-12-10 11:09:21 +01:00
|
|
|
func streamrelabelDebugSteps(qw422016 *qt422016.Writer, dss []promrelabel.DebugStep) {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:96
|
2022-12-10 11:09:21 +01:00
|
|
|
if len(dss) > 0 {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:96
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`<div class="m-3"><b>Original labels:</b> <samp>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:98
|
2022-12-10 11:09:21 +01:00
|
|
|
streammustFormatLabels(qw422016, dss[0].In)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:98
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</samp></div>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:100
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:100
|
2022-12-10 11:09:21 +01:00
|
|
|
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>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:111
|
2022-12-10 11:09:21 +01:00
|
|
|
for i, ds := range dss {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:113
|
2022-12-10 11:09:21 +01:00
|
|
|
inLabels := promutils.MustNewLabelsFromString(ds.In)
|
|
|
|
outLabels := promutils.MustNewLabelsFromString(ds.Out)
|
|
|
|
changedLabels := getChangedLabelNames(inLabels, outLabels)
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:116
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`<tr><td>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:118
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().D(i)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:118
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</td><td><b><pre class="m-2">`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:119
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().S(ds.Rule)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:119
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</pre></b></td><td><div class="m-2" style="font-size: 0.9em" title="deleted and updated labels highlighted in red">`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:122
|
2022-12-10 11:09:21 +01:00
|
|
|
streamlabelsWithHighlight(qw422016, inLabels, changedLabels, "red")
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:122
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</div></td><td><div class="m-2" style="font-size: 0.9em" title="added and updated labels highlighted in blue">`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:127
|
2022-12-10 11:09:21 +01:00
|
|
|
streamlabelsWithHighlight(qw422016, outLabels, changedLabels, "blue")
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:127
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</div></td></tr>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:131
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:131
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</tbody></table>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:134
|
2022-12-10 11:09:21 +01:00
|
|
|
if len(dss) > 0 {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:134
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`<div class="m-3"><b>Resulting labels:</b> <samp>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:136
|
2022-12-10 11:09:21 +01:00
|
|
|
streammustFormatLabels(qw422016, dss[len(dss)-1].Out)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:136
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</samp></div>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:138
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []promrelabel.DebugStep) {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
streamrelabelDebugSteps(qw422016, dss)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
func relabelDebugSteps(dss []promrelabel.DebugStep) string {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
writerelabelDebugSteps(qb422016, dss)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
return qs422016
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:139
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:141
|
2022-12-10 11:09:21 +01:00
|
|
|
func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:143
|
2022-12-10 11:09:21 +01:00
|
|
|
labelsList := labels.GetLabels()
|
|
|
|
metricName := ""
|
|
|
|
for i, label := range labelsList {
|
|
|
|
if label.Name == "__name__" {
|
|
|
|
metricName = label.Value
|
|
|
|
labelsList = append(labelsList[:i], labelsList[i+1:]...)
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:153
|
2022-12-10 11:09:21 +01:00
|
|
|
if metricName != "" {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:154
|
2022-12-10 11:09:21 +01:00
|
|
|
if _, ok := highlight["__name__"]; ok {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:154
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`<span style="font-weight:bold;color:`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:155
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().S(color)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:155
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:155
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().S(metricName)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:155
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</span>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:156
|
2022-12-10 11:09:21 +01:00
|
|
|
} else {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:157
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().S(metricName)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:158
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:159
|
2022-12-10 11:09:21 +01:00
|
|
|
if len(labelsList) == 0 {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:159
|
2022-12-10 11:09:21 +01:00
|
|
|
return
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:159
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:160
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:160
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`{`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:162
|
2022-12-10 11:09:21 +01:00
|
|
|
for i, label := range labelsList {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:163
|
2022-12-10 11:09:21 +01:00
|
|
|
if _, ok := highlight[label.Name]; ok {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:163
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`<span style="font-weight:bold;color:`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:164
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().S(color)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:164
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`">`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:164
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().S(label.Name)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:164
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`=`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:164
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().Q(label.Value)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:164
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`</span>`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:165
|
2022-12-10 11:09:21 +01:00
|
|
|
} else {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:166
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().S(label.Name)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:166
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`=`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:166
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.E().Q(label.Value)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:167
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:168
|
2022-12-10 11:09:21 +01:00
|
|
|
if i < len(labelsList)-1 {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:168
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`,`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:168
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(` `)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:168
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:169
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:169
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016.N().S(`}`)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
func writelabelsWithHighlight(qq422016 qtio422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
streamlabelsWithHighlight(qw422016, labels, highlight, color)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
func labelsWithHighlight(labels *promutils.Labels, highlight map[string]struct{}, color string) string {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
writelabelsWithHighlight(qb422016, labels, highlight, color)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
return qs422016
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:171
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:173
|
2022-12-10 11:09:21 +01:00
|
|
|
func streammustFormatLabels(qw422016 *qt422016.Writer, s string) {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:174
|
2022-12-10 11:09:21 +01:00
|
|
|
labels := promutils.MustNewLabelsFromString(s)
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:175
|
2022-12-10 11:09:21 +01:00
|
|
|
streamlabelsWithHighlight(qw422016, labels, nil, "")
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
func writemustFormatLabels(qq422016 qtio422016.Writer, s string) {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
streammustFormatLabels(qw422016, s)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
func mustFormatLabels(s string) string {
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
writemustFormatLabels(qb422016, s)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
return qs422016
|
2022-12-10 21:44:09 +01:00
|
|
|
//line lib/promscrape/relabel_debug.qtpl:176
|
2022-12-10 11:09:21 +01:00
|
|
|
}
|