2023-01-04 07:26:27 +00:00
|
|
|
// Code generated by qtc from "debug.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:1
|
|
|
|
package promrelabel
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:1
|
|
|
|
import (
|
2023-04-26 08:53:29 +00:00
|
|
|
"fmt"
|
2023-01-04 07:26:27 +00:00
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/htmlcomponents"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promutils"
|
|
|
|
)
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:9
|
2023-01-04 07:26:27 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:9
|
2023-01-04 07:26:27 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:9
|
|
|
|
func StreamRelabelDebugSteps(qw422016 *qt422016.Writer, targetURL, targetID, format string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promrelabel/debug.qtpl:10
|
|
|
|
if format == "json" {
|
|
|
|
//line lib/promrelabel/debug.qtpl:11
|
|
|
|
StreamRelabelDebugStepsJSON(qw422016, targetURL, targetID, dss, metric, relabelConfigs, err)
|
2023-01-04 07:26:27 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:12
|
2023-04-26 08:53:29 +00:00
|
|
|
} else {
|
|
|
|
//line lib/promrelabel/debug.qtpl:13
|
|
|
|
StreamRelabelDebugStepsHTML(qw422016, targetURL, targetID, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promrelabel/debug.qtpl:14
|
|
|
|
}
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
func WriteRelabelDebugSteps(qq422016 qtio422016.Writer, targetURL, targetID, format string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
StreamRelabelDebugSteps(qw422016, targetURL, targetID, format, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
qt422016.ReleaseWriter(qw422016)
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
func RelabelDebugSteps(targetURL, targetID, format string, dss []DebugStep, metric, relabelConfigs string, err error) string {
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
WriteRelabelDebugSteps(qb422016, targetURL, targetID, format, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
qs422016 := string(qb422016.B)
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
return qs422016
|
|
|
|
//line lib/promrelabel/debug.qtpl:15
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:17
|
|
|
|
func StreamRelabelDebugStepsHTML(qw422016 *qt422016.Writer, targetURL, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promrelabel/debug.qtpl:17
|
|
|
|
qw422016.N().S(`<!DOCTYPE html><html lang="en"><head>`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:21
|
2023-01-04 07:26:27 +00:00
|
|
|
htmlcomponents.StreamCommonHeader(qw422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:21
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`<title>Metric relabel debug</title><script>function submitRelabelDebugForm(e) {var form = e.target;var method = "GET";if (form.elements["relabel_configs"].value.length + form.elements["metric"].value.length > 1000) {method = "POST";}form.method = method;}</script></head><body>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:35
|
2023-01-04 07:26:27 +00:00
|
|
|
htmlcomponents.StreamNavbar(qw422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:35
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`<div class="container-fluid"><a href="https://docs.victoriametrics.com/relabeling.html" target="_blank">Relabeling docs</a>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:37
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(` `)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:39
|
2023-03-21 05:07:52 +00:00
|
|
|
if targetURL != "" {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:39
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`<a href="metric-relabel-debug`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:40
|
2023-01-06 00:35:20 +00:00
|
|
|
if targetID != "" {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:40
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`?id=`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:40
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.E().S(targetID)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:40
|
2023-01-06 00:35:20 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:40
|
2023-01-05 11:26:47 +00:00
|
|
|
qw422016.N().S(`">Metric relabel debug</a>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:41
|
2023-01-05 11:26:47 +00:00
|
|
|
} else {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:41
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`<a href="target-relabel-debug`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:42
|
2023-01-06 00:35:20 +00:00
|
|
|
if targetID != "" {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:42
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`?id=`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:42
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.E().S(targetID)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:42
|
2023-01-06 00:35:20 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:42
|
2023-01-05 11:26:47 +00:00
|
|
|
qw422016.N().S(`">Target relabel debug</a>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:43
|
2023-01-05 11:26:47 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:43
|
2023-01-05 11:26:47 +00:00
|
|
|
qw422016.N().S(`<br>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:46
|
2023-01-04 07:26:27 +00:00
|
|
|
if err != nil {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:47
|
2023-01-04 07:26:27 +00:00
|
|
|
htmlcomponents.StreamErrorNotification(qw422016, err)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:48
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:48
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`<div class="m-3"><form method="POST" onsubmit="submitRelabelDebugForm(event)">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:52
|
2023-01-04 07:26:27 +00:00
|
|
|
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:53
|
2023-01-04 07:26:27 +00:00
|
|
|
if targetID != "" {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:53
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`<input type="hidden" name="id" value="`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:54
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.E().S(targetID)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:54
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`" />`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:55
|
2023-01-06 00:35:20 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:55
|
2023-01-06 00:35:20 +00:00
|
|
|
qw422016.N().S(`<input type="submit" value="Submit" class="btn btn-primary m-1" />`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:57
|
2023-01-06 00:35:20 +00:00
|
|
|
if targetID != "" {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:57
|
2023-01-05 11:26:47 +00:00
|
|
|
qw422016.N().S(`<button type="button" onclick="location.href='?id=`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:58
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(targetID)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:58
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`'" class="btn btn-secondary m-1">Reset</button>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:59
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:59
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</form></div><div class="row"><main class="col-12">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:65
|
2023-03-21 05:07:52 +00:00
|
|
|
streamrelabelDebugSteps(qw422016, dss, targetURL, targetID)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:65
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</main></div></div></body></html>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
|
|
|
func WriteRelabelDebugStepsHTML(qq422016 qtio422016.Writer, targetURL, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
|
|
|
StreamRelabelDebugStepsHTML(qw422016, targetURL, targetID, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
|
|
|
func RelabelDebugStepsHTML(targetURL, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) string {
|
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
|
|
|
WriteRelabelDebugStepsHTML(qb422016, targetURL, targetID, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
return qs422016
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:71
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:73
|
2023-01-04 07:26:27 +00:00
|
|
|
func streamrelabelDebugFormInputs(qw422016 *qt422016.Writer, metric, relabelConfigs string) {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:73
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`<div>Relabel configs:<br/><textarea name="relabel_configs" style="width: 100%; height: 15em" class="m-1">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:76
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(relabelConfigs)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:76
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</textarea></div><div>Labels:<br/><textarea name="metric" style="width: 100%; height: 5em" class="m-1">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:81
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(metric)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:81
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</textarea></div>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
func writerelabelDebugFormInputs(qq422016 qtio422016.Writer, metric, relabelConfigs string) {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
func relabelDebugFormInputs(metric, relabelConfigs string) string {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
writerelabelDebugFormInputs(qb422016, metric, relabelConfigs)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
return qs422016
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:83
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:85
|
2023-03-21 05:07:52 +00:00
|
|
|
func streamrelabelDebugSteps(qw422016 *qt422016.Writer, dss []DebugStep, targetURL, targetID string) {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:86
|
2023-01-04 07:26:27 +00:00
|
|
|
if len(dss) > 0 {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:86
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`<div class="m-3"><b>Original labels:</b> <samp>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:88
|
2023-01-04 07:26:27 +00:00
|
|
|
streammustFormatLabels(qw422016, dss[0].In)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:88
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</samp></div>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:90
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:90
|
2023-01-04 07:26:27 +00: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>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:101
|
2023-01-04 07:26:27 +00:00
|
|
|
for i, ds := range dss {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:103
|
2023-01-04 07:26:27 +00:00
|
|
|
inLabels := promutils.MustNewLabelsFromString(ds.In)
|
|
|
|
outLabels := promutils.MustNewLabelsFromString(ds.Out)
|
|
|
|
changedLabels := getChangedLabelNames(inLabels, outLabels)
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:106
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`<tr><td>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:108
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().D(i)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:108
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</td><td><b><pre class="m-2">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:109
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(ds.Rule)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:109
|
2023-01-04 07:26:27 +00: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">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:112
|
2023-01-04 07:26:27 +00:00
|
|
|
streamlabelsWithHighlight(qw422016, inLabels, changedLabels, "red")
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:112
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</div></td><td><div class="m-2" style="font-size: 0.9em" title="added and updated labels highlighted in blue">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:117
|
2023-01-04 07:26:27 +00:00
|
|
|
streamlabelsWithHighlight(qw422016, outLabels, changedLabels, "blue")
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:117
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</div></td></tr>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:121
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:121
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</tbody></table>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:124
|
2023-01-04 07:26:27 +00:00
|
|
|
if len(dss) > 0 {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:124
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`<div class="m-3"><b>Resulting labels:</b> <samp>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:126
|
2023-01-04 07:26:27 +00:00
|
|
|
streammustFormatLabels(qw422016, dss[len(dss)-1].Out)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:126
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`</samp>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:127
|
2023-03-21 05:07:52 +00:00
|
|
|
if targetURL != "" {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:127
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`<div><b>Target URL:</b>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:129
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(` `)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:129
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`<a href="`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:129
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.E().S(targetURL)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:129
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`" target="_blank">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:129
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.E().S(targetURL)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:129
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`</a>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:130
|
2023-03-21 05:07:52 +00:00
|
|
|
if targetID != "" {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:131
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(` `)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:131
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`(<a href="target_response?id=`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:132
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.E().S(targetID)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:132
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`" target="_blank" title="click to fetch target response on behalf of the scraper">response</a>)`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:133
|
2023-03-21 05:07:52 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:133
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`</div>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:135
|
2023-03-21 05:07:52 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:135
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016.N().S(`</div>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:137
|
2023-03-21 05:07:52 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-03-21 05:07:52 +00:00
|
|
|
func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []DebugStep, targetURL, targetID string) {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-03-21 05:07:52 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-03-21 05:07:52 +00:00
|
|
|
streamrelabelDebugSteps(qw422016, dss, targetURL, targetID)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-03-21 05:07:52 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-03-21 05:07:52 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-03-21 05:07:52 +00:00
|
|
|
func relabelDebugSteps(dss []DebugStep, targetURL, targetID string) string {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-01-04 07:26:27 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-03-21 05:07:52 +00:00
|
|
|
writerelabelDebugSteps(qb422016, dss, targetURL, targetID)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-01-04 07:26:27 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-01-04 07:26:27 +00:00
|
|
|
return qs422016
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:138
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:140
|
|
|
|
func StreamRelabelDebugStepsJSON(qw422016 *qt422016.Writer, targetURL, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promrelabel/debug.qtpl:140
|
|
|
|
qw422016.N().S(`{`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:142
|
|
|
|
if err != nil {
|
|
|
|
//line lib/promrelabel/debug.qtpl:142
|
|
|
|
qw422016.N().S(`"status": "error","error":`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:144
|
|
|
|
qw422016.N().Q(fmt.Sprintf("Error: %s", err))
|
|
|
|
//line lib/promrelabel/debug.qtpl:145
|
|
|
|
} else {
|
|
|
|
//line lib/promrelabel/debug.qtpl:145
|
|
|
|
qw422016.N().S(`"status": "success",`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:147
|
|
|
|
if len(dss) > 0 {
|
|
|
|
//line lib/promrelabel/debug.qtpl:147
|
|
|
|
qw422016.N().S(`"originalLabels":`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:148
|
2023-05-08 21:57:09 +00:00
|
|
|
qw422016.N().Q(mustFormatLabels(dss[0].In))
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:148
|
|
|
|
qw422016.N().S(`,"resultingLabels":`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:149
|
2023-05-08 21:57:09 +00:00
|
|
|
qw422016.N().Q(mustFormatLabels(dss[len(dss)-1].Out))
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:149
|
|
|
|
qw422016.N().S(`,`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:150
|
|
|
|
}
|
|
|
|
//line lib/promrelabel/debug.qtpl:150
|
|
|
|
qw422016.N().S(`"steps": [`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:152
|
|
|
|
for i, ds := range dss {
|
|
|
|
//line lib/promrelabel/debug.qtpl:154
|
|
|
|
inLabels := promutils.MustNewLabelsFromString(ds.In)
|
|
|
|
outLabels := promutils.MustNewLabelsFromString(ds.Out)
|
|
|
|
changedLabels := getChangedLabelNames(inLabels, outLabels)
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:157
|
|
|
|
qw422016.N().S(`{"inLabels":`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:159
|
|
|
|
qw422016.N().Q(labelsWithHighlight(inLabels, changedLabels, "red"))
|
|
|
|
//line lib/promrelabel/debug.qtpl:159
|
|
|
|
qw422016.N().S(`,"outLabels":`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:160
|
|
|
|
qw422016.N().Q(labelsWithHighlight(outLabels, changedLabels, "blue"))
|
|
|
|
//line lib/promrelabel/debug.qtpl:160
|
|
|
|
qw422016.N().S(`,"rule":`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:161
|
|
|
|
qw422016.N().Q(ds.Rule)
|
|
|
|
//line lib/promrelabel/debug.qtpl:161
|
|
|
|
qw422016.N().S(`}`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:163
|
|
|
|
if i != len(dss)-1 {
|
|
|
|
//line lib/promrelabel/debug.qtpl:163
|
|
|
|
qw422016.N().S(`,`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:163
|
|
|
|
}
|
|
|
|
//line lib/promrelabel/debug.qtpl:164
|
|
|
|
}
|
|
|
|
//line lib/promrelabel/debug.qtpl:164
|
|
|
|
qw422016.N().S(`]`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:166
|
|
|
|
}
|
|
|
|
//line lib/promrelabel/debug.qtpl:166
|
|
|
|
qw422016.N().S(`}`)
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
func WriteRelabelDebugStepsJSON(qq422016 qtio422016.Writer, targetURL, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
StreamRelabelDebugStepsJSON(qw422016, targetURL, targetID, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
qt422016.ReleaseWriter(qw422016)
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
func RelabelDebugStepsJSON(targetURL, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) string {
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
WriteRelabelDebugStepsJSON(qb422016, targetURL, targetID, dss, metric, relabelConfigs, err)
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
qs422016 := string(qb422016.B)
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
return qs422016
|
|
|
|
//line lib/promrelabel/debug.qtpl:168
|
|
|
|
}
|
|
|
|
|
|
|
|
//line lib/promrelabel/debug.qtpl:170
|
2023-01-04 07:26:27 +00:00
|
|
|
func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:172
|
2023-01-04 07:26:27 +00: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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:182
|
2023-01-04 07:26:27 +00:00
|
|
|
if metricName != "" {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:183
|
2023-01-04 07:26:27 +00:00
|
|
|
if _, ok := highlight["__name__"]; ok {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:183
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`<span style="font-weight:bold;color:`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:184
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(color)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:184
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:184
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(metricName)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:184
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</span>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:185
|
2023-01-04 07:26:27 +00:00
|
|
|
} else {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:186
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(metricName)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:187
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:188
|
2023-01-04 07:26:27 +00:00
|
|
|
if len(labelsList) == 0 {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:188
|
2023-01-04 07:26:27 +00:00
|
|
|
return
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:188
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:189
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:189
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`{`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:191
|
2023-01-04 07:26:27 +00:00
|
|
|
for i, label := range labelsList {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:192
|
2023-01-04 07:26:27 +00:00
|
|
|
if _, ok := highlight[label.Name]; ok {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:192
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`<span style="font-weight:bold;color:`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:193
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(color)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:193
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`">`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:193
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(label.Name)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:193
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`=`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:193
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().Q(label.Value)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:193
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`</span>`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:194
|
2023-01-04 07:26:27 +00:00
|
|
|
} else {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:195
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().S(label.Name)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:195
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`=`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:195
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.E().Q(label.Value)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:196
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:197
|
2023-01-04 07:26:27 +00:00
|
|
|
if i < len(labelsList)-1 {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:197
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`,`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:197
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(` `)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:197
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:198
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:198
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016.N().S(`}`)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
func writelabelsWithHighlight(qq422016 qtio422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
streamlabelsWithHighlight(qw422016, labels, highlight, color)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
func labelsWithHighlight(labels *promutils.Labels, highlight map[string]struct{}, color string) string {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
writelabelsWithHighlight(qb422016, labels, highlight, color)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
return qs422016
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:200
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:202
|
2023-01-04 07:26:27 +00:00
|
|
|
func streammustFormatLabels(qw422016 *qt422016.Writer, s string) {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:203
|
2023-01-04 07:26:27 +00:00
|
|
|
labels := promutils.MustNewLabelsFromString(s)
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:204
|
2023-01-04 07:26:27 +00:00
|
|
|
streamlabelsWithHighlight(qw422016, labels, nil, "")
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
func writemustFormatLabels(qq422016 qtio422016.Writer, s string) {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
streammustFormatLabels(qw422016, s)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
func mustFormatLabels(s string) string {
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
writemustFormatLabels(qb422016, s)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
return qs422016
|
2023-04-26 08:53:29 +00:00
|
|
|
//line lib/promrelabel/debug.qtpl:205
|
2023-01-04 07:26:27 +00:00
|
|
|
}
|