// 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 (
"github.com/VictoriaMetrics/VictoriaMetrics/lib/htmlcomponents"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promutils"
)
//line lib/promrelabel/debug.qtpl:8
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line lib/promrelabel/debug.qtpl:8
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line lib/promrelabel/debug.qtpl:8
func StreamMetricRelabelDebugSteps(qw422016 *qt422016.Writer, dss []DebugStep, metric, relabelConfigs string, err error) {
//line lib/promrelabel/debug.qtpl:8
qw422016.N().S(`
`)
//line lib/promrelabel/debug.qtpl:12
htmlcomponents.StreamCommonHeader(qw422016)
//line lib/promrelabel/debug.qtpl:12
qw422016.N().S(`Metric relabel debug`)
//line lib/promrelabel/debug.qtpl:16
htmlcomponents.StreamNavbar(qw422016)
//line lib/promrelabel/debug.qtpl:16
qw422016.N().S(`Relabeling docs`)
//line lib/promrelabel/debug.qtpl:18
qw422016.N().S(` `)
//line lib/promrelabel/debug.qtpl:18
qw422016.N().S(`
Target relabel debug`)
//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(`
`)
//line lib/promrelabel/debug.qtpl:35
streamrelabelDebugSteps(qw422016, dss)
//line lib/promrelabel/debug.qtpl:35
qw422016.N().S(`
`)
//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(``)
//line lib/promrelabel/debug.qtpl:47
htmlcomponents.StreamCommonHeader(qw422016)
//line lib/promrelabel/debug.qtpl:47
qw422016.N().S(`Target relabel debug`)
//line lib/promrelabel/debug.qtpl:51
htmlcomponents.StreamNavbar(qw422016)
//line lib/promrelabel/debug.qtpl:51
qw422016.N().S(`Relabeling docs`)
//line lib/promrelabel/debug.qtpl:53
qw422016.N().S(` `)
//line lib/promrelabel/debug.qtpl:53
qw422016.N().S(`
Metric relabel debug`)
//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(`
`)
//line lib/promrelabel/debug.qtpl:75
streamrelabelDebugSteps(qw422016, dss)
//line lib/promrelabel/debug.qtpl:75
qw422016.N().S(`
`)
//line lib/promrelabel/debug.qtpl:81
}
//line lib/promrelabel/debug.qtpl:81
func WriteTargetRelabelDebugSteps(qq422016 qtio422016.Writer, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) {
//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(`Relabel configs:
Labels:
`)
//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)
//line lib/promrelabel/debug.qtpl:93
qt422016.ReleaseWriter(qw422016)
//line lib/promrelabel/debug.qtpl:93
}
//line lib/promrelabel/debug.qtpl:93
func relabelDebugFormInputs(metric, relabelConfigs string) string {
//line lib/promrelabel/debug.qtpl:93
qb422016 := qt422016.AcquireByteBuffer()
//line lib/promrelabel/debug.qtpl:93
writerelabelDebugFormInputs(qb422016, metric, relabelConfigs)
//line lib/promrelabel/debug.qtpl:93
qs422016 := string(qb422016.B)
//line lib/promrelabel/debug.qtpl:93
qt422016.ReleaseByteBuffer(qb422016)
//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(`Original labels: `)
//line lib/promrelabel/debug.qtpl:98
streammustFormatLabels(qw422016, dss[0].In)
//line lib/promrelabel/debug.qtpl:98
qw422016.N().S(`
`)
//line lib/promrelabel/debug.qtpl:100
}
//line lib/promrelabel/debug.qtpl:100
qw422016.N().S(`Step | Relabeling Rule | Input Labels | Output labels |
`)
//line lib/promrelabel/debug.qtpl:111
for i, ds := range dss {
//line lib/promrelabel/debug.qtpl:113
inLabels := promutils.MustNewLabelsFromString(ds.In)
outLabels := promutils.MustNewLabelsFromString(ds.Out)
changedLabels := getChangedLabelNames(inLabels, outLabels)
//line lib/promrelabel/debug.qtpl:116
qw422016.N().S(``)
//line lib/promrelabel/debug.qtpl:118
qw422016.N().D(i)
//line lib/promrelabel/debug.qtpl:118
qw422016.N().S(` | `)
//line lib/promrelabel/debug.qtpl:119
qw422016.E().S(ds.Rule)
//line lib/promrelabel/debug.qtpl:119
qw422016.N().S(` | `)
//line lib/promrelabel/debug.qtpl:122
streamlabelsWithHighlight(qw422016, inLabels, changedLabels, "red")
//line lib/promrelabel/debug.qtpl:122
qw422016.N().S(` | `)
//line lib/promrelabel/debug.qtpl:127
streamlabelsWithHighlight(qw422016, outLabels, changedLabels, "blue")
//line lib/promrelabel/debug.qtpl:127
qw422016.N().S(` |
`)
//line lib/promrelabel/debug.qtpl:131
}
//line lib/promrelabel/debug.qtpl:131
qw422016.N().S(`
`)
//line lib/promrelabel/debug.qtpl:134
if len(dss) > 0 {
//line lib/promrelabel/debug.qtpl:134
qw422016.N().S(`Resulting labels: `)
//line lib/promrelabel/debug.qtpl:136
streammustFormatLabels(qw422016, dss[len(dss)-1].Out)
//line lib/promrelabel/debug.qtpl:136
qw422016.N().S(`
`)
//line lib/promrelabel/debug.qtpl:138
}
//line lib/promrelabel/debug.qtpl:139
}
//line lib/promrelabel/debug.qtpl:139
func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []DebugStep) {
//line lib/promrelabel/debug.qtpl:139
qw422016 := qt422016.AcquireWriter(qq422016)
//line lib/promrelabel/debug.qtpl:139
streamrelabelDebugSteps(qw422016, dss)
//line lib/promrelabel/debug.qtpl:139
qt422016.ReleaseWriter(qw422016)
//line lib/promrelabel/debug.qtpl:139
}
//line lib/promrelabel/debug.qtpl:139
func relabelDebugSteps(dss []DebugStep) string {
//line lib/promrelabel/debug.qtpl:139
qb422016 := qt422016.AcquireByteBuffer()
//line lib/promrelabel/debug.qtpl:139
writerelabelDebugSteps(qb422016, dss)
//line lib/promrelabel/debug.qtpl:139
qs422016 := string(qb422016.B)
//line lib/promrelabel/debug.qtpl:139
qt422016.ReleaseByteBuffer(qb422016)
//line lib/promrelabel/debug.qtpl:139
return qs422016
//line lib/promrelabel/debug.qtpl:139
}
//line lib/promrelabel/debug.qtpl:141
func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
//line lib/promrelabel/debug.qtpl:143
labelsList := labels.GetLabels()
metricName := ""
for i, label := range labelsList {
if label.Name == "__name__" {
metricName = label.Value
labelsList = append(labelsList[:i], labelsList[i+1:]...)
break
}
}
//line lib/promrelabel/debug.qtpl:153
if metricName != "" {
//line lib/promrelabel/debug.qtpl:154
if _, ok := highlight["__name__"]; ok {
//line lib/promrelabel/debug.qtpl:154
qw422016.N().S(``)
//line lib/promrelabel/debug.qtpl:155
qw422016.E().S(metricName)
//line lib/promrelabel/debug.qtpl:155
qw422016.N().S(``)
//line lib/promrelabel/debug.qtpl:156
} else {
//line lib/promrelabel/debug.qtpl:157
qw422016.E().S(metricName)
//line lib/promrelabel/debug.qtpl:158
}
//line lib/promrelabel/debug.qtpl:159
if len(labelsList) == 0 {
//line lib/promrelabel/debug.qtpl:159
return
//line lib/promrelabel/debug.qtpl:159
}
//line lib/promrelabel/debug.qtpl:160
}
//line lib/promrelabel/debug.qtpl:160
qw422016.N().S(`{`)
//line lib/promrelabel/debug.qtpl:162
for i, label := range labelsList {
//line lib/promrelabel/debug.qtpl:163
if _, ok := highlight[label.Name]; ok {
//line lib/promrelabel/debug.qtpl:163
qw422016.N().S(``)
//line lib/promrelabel/debug.qtpl:164
qw422016.E().S(label.Name)
//line lib/promrelabel/debug.qtpl:164
qw422016.N().S(`=`)
//line lib/promrelabel/debug.qtpl:164
qw422016.E().Q(label.Value)
//line lib/promrelabel/debug.qtpl:164
qw422016.N().S(``)
//line lib/promrelabel/debug.qtpl:165
} else {
//line lib/promrelabel/debug.qtpl:166
qw422016.E().S(label.Name)
//line lib/promrelabel/debug.qtpl:166
qw422016.N().S(`=`)
//line lib/promrelabel/debug.qtpl:166
qw422016.E().Q(label.Value)
//line lib/promrelabel/debug.qtpl:167
}
//line lib/promrelabel/debug.qtpl:168
if i < len(labelsList)-1 {
//line lib/promrelabel/debug.qtpl:168
qw422016.N().S(`,`)
//line lib/promrelabel/debug.qtpl:168
qw422016.N().S(` `)
//line lib/promrelabel/debug.qtpl:168
}
//line lib/promrelabel/debug.qtpl:169
}
//line lib/promrelabel/debug.qtpl:169
qw422016.N().S(`}`)
//line lib/promrelabel/debug.qtpl:171
}
//line lib/promrelabel/debug.qtpl:171
func writelabelsWithHighlight(qq422016 qtio422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
//line lib/promrelabel/debug.qtpl:171
qw422016 := qt422016.AcquireWriter(qq422016)
//line lib/promrelabel/debug.qtpl:171
streamlabelsWithHighlight(qw422016, labels, highlight, color)
//line lib/promrelabel/debug.qtpl:171
qt422016.ReleaseWriter(qw422016)
//line lib/promrelabel/debug.qtpl:171
}
//line lib/promrelabel/debug.qtpl:171
func labelsWithHighlight(labels *promutils.Labels, highlight map[string]struct{}, color string) string {
//line lib/promrelabel/debug.qtpl:171
qb422016 := qt422016.AcquireByteBuffer()
//line lib/promrelabel/debug.qtpl:171
writelabelsWithHighlight(qb422016, labels, highlight, color)
//line lib/promrelabel/debug.qtpl:171
qs422016 := string(qb422016.B)
//line lib/promrelabel/debug.qtpl:171
qt422016.ReleaseByteBuffer(qb422016)
//line lib/promrelabel/debug.qtpl:171
return qs422016
//line lib/promrelabel/debug.qtpl:171
}
//line lib/promrelabel/debug.qtpl:173
func streammustFormatLabels(qw422016 *qt422016.Writer, s string) {
//line lib/promrelabel/debug.qtpl:174
labels := promutils.MustNewLabelsFromString(s)
//line lib/promrelabel/debug.qtpl:175
streamlabelsWithHighlight(qw422016, labels, nil, "")
//line lib/promrelabel/debug.qtpl:176
}
//line lib/promrelabel/debug.qtpl:176
func writemustFormatLabels(qq422016 qtio422016.Writer, s string) {
//line lib/promrelabel/debug.qtpl:176
qw422016 := qt422016.AcquireWriter(qq422016)
//line lib/promrelabel/debug.qtpl:176
streammustFormatLabels(qw422016, s)
//line lib/promrelabel/debug.qtpl:176
qt422016.ReleaseWriter(qw422016)
//line lib/promrelabel/debug.qtpl:176
}
//line lib/promrelabel/debug.qtpl:176
func mustFormatLabels(s string) string {
//line lib/promrelabel/debug.qtpl:176
qb422016 := qt422016.AcquireByteBuffer()
//line lib/promrelabel/debug.qtpl:176
writemustFormatLabels(qb422016, s)
//line lib/promrelabel/debug.qtpl:176
qs422016 := string(qb422016.B)
//line lib/promrelabel/debug.qtpl:176
qt422016.ReleaseByteBuffer(qb422016)
//line lib/promrelabel/debug.qtpl:176
return qs422016
//line lib/promrelabel/debug.qtpl:176
}