// 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(``) //line lib/promscrape/relabel_debug.qtpl:12 streamcommonHeader(qw422016) //line lib/promscrape/relabel_debug.qtpl:12 qw422016.N().S(`Metric relabel debug`) //line lib/promscrape/relabel_debug.qtpl:16 streamnavbar(qw422016) //line lib/promscrape/relabel_debug.qtpl:16 qw422016.N().S(`
Relabeling docs
`) //line lib/promscrape/relabel_debug.qtpl:19 if err != nil { //line lib/promscrape/relabel_debug.qtpl:20 streamerrorNotification(qw422016, err) //line lib/promscrape/relabel_debug.qtpl:21 } //line lib/promscrape/relabel_debug.qtpl:21 qw422016.N().S(`
Relabel configs:
Metric with labels:
`) //line lib/promscrape/relabel_debug.qtpl:40 streamrelabelDebugSteps(qw422016, dss) //line lib/promscrape/relabel_debug.qtpl:40 qw422016.N().S(`
`) //line lib/promscrape/relabel_debug.qtpl:46 } //line lib/promscrape/relabel_debug.qtpl:46 func WriteMetricRelabelDebugSteps(qq422016 qtio422016.Writer, dss []promrelabel.DebugStep, metric, relabelConfigs string, err error) { //line lib/promscrape/relabel_debug.qtpl:46 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promscrape/relabel_debug.qtpl:46 StreamMetricRelabelDebugSteps(qw422016, dss, metric, relabelConfigs, err) //line lib/promscrape/relabel_debug.qtpl:46 qt422016.ReleaseWriter(qw422016) //line lib/promscrape/relabel_debug.qtpl:46 } //line lib/promscrape/relabel_debug.qtpl:46 func MetricRelabelDebugSteps(dss []promrelabel.DebugStep, metric, relabelConfigs string, err error) string { //line lib/promscrape/relabel_debug.qtpl:46 qb422016 := qt422016.AcquireByteBuffer() //line lib/promscrape/relabel_debug.qtpl:46 WriteMetricRelabelDebugSteps(qb422016, dss, metric, relabelConfigs, err) //line lib/promscrape/relabel_debug.qtpl:46 qs422016 := string(qb422016.B) //line lib/promscrape/relabel_debug.qtpl:46 qt422016.ReleaseByteBuffer(qb422016) //line lib/promscrape/relabel_debug.qtpl:46 return qs422016 //line lib/promscrape/relabel_debug.qtpl:46 } //line lib/promscrape/relabel_debug.qtpl:48 func StreamTargetRelabelDebugSteps(qw422016 *qt422016.Writer, dss []promrelabel.DebugStep) { //line lib/promscrape/relabel_debug.qtpl:48 qw422016.N().S(``) //line lib/promscrape/relabel_debug.qtpl:52 streamcommonHeader(qw422016) //line lib/promscrape/relabel_debug.qtpl:52 qw422016.N().S(`Target relabel debug`) //line lib/promscrape/relabel_debug.qtpl:56 streamnavbar(qw422016) //line lib/promscrape/relabel_debug.qtpl:56 qw422016.N().S(`
Relabeling docs
`) //line lib/promscrape/relabel_debug.qtpl:61 streamrelabelDebugSteps(qw422016, dss) //line lib/promscrape/relabel_debug.qtpl:61 qw422016.N().S(`
`) //line lib/promscrape/relabel_debug.qtpl:67 } //line lib/promscrape/relabel_debug.qtpl:67 func WriteTargetRelabelDebugSteps(qq422016 qtio422016.Writer, dss []promrelabel.DebugStep) { //line lib/promscrape/relabel_debug.qtpl:67 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promscrape/relabel_debug.qtpl:67 StreamTargetRelabelDebugSteps(qw422016, dss) //line lib/promscrape/relabel_debug.qtpl:67 qt422016.ReleaseWriter(qw422016) //line lib/promscrape/relabel_debug.qtpl:67 } //line lib/promscrape/relabel_debug.qtpl:67 func TargetRelabelDebugSteps(dss []promrelabel.DebugStep) string { //line lib/promscrape/relabel_debug.qtpl:67 qb422016 := qt422016.AcquireByteBuffer() //line lib/promscrape/relabel_debug.qtpl:67 WriteTargetRelabelDebugSteps(qb422016, dss) //line lib/promscrape/relabel_debug.qtpl:67 qs422016 := string(qb422016.B) //line lib/promscrape/relabel_debug.qtpl:67 qt422016.ReleaseByteBuffer(qb422016) //line lib/promscrape/relabel_debug.qtpl:67 return qs422016 //line lib/promscrape/relabel_debug.qtpl:67 } //line lib/promscrape/relabel_debug.qtpl:69 func streamrelabelDebugSteps(qw422016 *qt422016.Writer, dss []promrelabel.DebugStep) { //line lib/promscrape/relabel_debug.qtpl:70 if len(dss) > 0 { //line lib/promscrape/relabel_debug.qtpl:70 qw422016.N().S(`
Original labels: `) //line lib/promscrape/relabel_debug.qtpl:72 streammustFormatLabels(qw422016, dss[0].In) //line lib/promscrape/relabel_debug.qtpl:72 qw422016.N().S(`
`) //line lib/promscrape/relabel_debug.qtpl:74 } //line lib/promscrape/relabel_debug.qtpl:74 qw422016.N().S(``) //line lib/promscrape/relabel_debug.qtpl:85 for i, ds := range dss { //line lib/promscrape/relabel_debug.qtpl:87 inLabels := promutils.MustNewLabelsFromString(ds.In) outLabels := promutils.MustNewLabelsFromString(ds.Out) changedLabels := getChangedLabelNames(inLabels, outLabels) //line lib/promscrape/relabel_debug.qtpl:90 qw422016.N().S(``) //line lib/promscrape/relabel_debug.qtpl:105 } //line lib/promscrape/relabel_debug.qtpl:105 qw422016.N().S(`
StepRelabeling RuleInput LabelsOutput labels
`) //line lib/promscrape/relabel_debug.qtpl:92 qw422016.N().D(i) //line lib/promscrape/relabel_debug.qtpl:92 qw422016.N().S(`
`)
//line lib/promscrape/relabel_debug.qtpl:93
		qw422016.E().S(ds.Rule)
//line lib/promscrape/relabel_debug.qtpl:93
		qw422016.N().S(`
`) //line lib/promscrape/relabel_debug.qtpl:96 streamlabelsWithHighlight(qw422016, inLabels, changedLabels, "red") //line lib/promscrape/relabel_debug.qtpl:96 qw422016.N().S(`
`) //line lib/promscrape/relabel_debug.qtpl:101 streamlabelsWithHighlight(qw422016, outLabels, changedLabels, "blue") //line lib/promscrape/relabel_debug.qtpl:101 qw422016.N().S(`
`) //line lib/promscrape/relabel_debug.qtpl:108 if len(dss) > 0 { //line lib/promscrape/relabel_debug.qtpl:108 qw422016.N().S(`
Resulting labels: `) //line lib/promscrape/relabel_debug.qtpl:110 streammustFormatLabels(qw422016, dss[len(dss)-1].Out) //line lib/promscrape/relabel_debug.qtpl:110 qw422016.N().S(`
`) //line lib/promscrape/relabel_debug.qtpl:112 } //line lib/promscrape/relabel_debug.qtpl:113 } //line lib/promscrape/relabel_debug.qtpl:113 func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []promrelabel.DebugStep) { //line lib/promscrape/relabel_debug.qtpl:113 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promscrape/relabel_debug.qtpl:113 streamrelabelDebugSteps(qw422016, dss) //line lib/promscrape/relabel_debug.qtpl:113 qt422016.ReleaseWriter(qw422016) //line lib/promscrape/relabel_debug.qtpl:113 } //line lib/promscrape/relabel_debug.qtpl:113 func relabelDebugSteps(dss []promrelabel.DebugStep) string { //line lib/promscrape/relabel_debug.qtpl:113 qb422016 := qt422016.AcquireByteBuffer() //line lib/promscrape/relabel_debug.qtpl:113 writerelabelDebugSteps(qb422016, dss) //line lib/promscrape/relabel_debug.qtpl:113 qs422016 := string(qb422016.B) //line lib/promscrape/relabel_debug.qtpl:113 qt422016.ReleaseByteBuffer(qb422016) //line lib/promscrape/relabel_debug.qtpl:113 return qs422016 //line lib/promscrape/relabel_debug.qtpl:113 } //line lib/promscrape/relabel_debug.qtpl:115 func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) { //line lib/promscrape/relabel_debug.qtpl:117 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/promscrape/relabel_debug.qtpl:127 if metricName != "" { //line lib/promscrape/relabel_debug.qtpl:128 if _, ok := highlight["__name__"]; ok { //line lib/promscrape/relabel_debug.qtpl:128 qw422016.N().S(``) //line lib/promscrape/relabel_debug.qtpl:129 qw422016.E().S(metricName) //line lib/promscrape/relabel_debug.qtpl:129 qw422016.N().S(``) //line lib/promscrape/relabel_debug.qtpl:130 } else { //line lib/promscrape/relabel_debug.qtpl:131 qw422016.E().S(metricName) //line lib/promscrape/relabel_debug.qtpl:132 } //line lib/promscrape/relabel_debug.qtpl:133 if len(labelsList) == 0 { //line lib/promscrape/relabel_debug.qtpl:133 return //line lib/promscrape/relabel_debug.qtpl:133 } //line lib/promscrape/relabel_debug.qtpl:134 } //line lib/promscrape/relabel_debug.qtpl:134 qw422016.N().S(`{`) //line lib/promscrape/relabel_debug.qtpl:136 for i, label := range labelsList { //line lib/promscrape/relabel_debug.qtpl:137 if _, ok := highlight[label.Name]; ok { //line lib/promscrape/relabel_debug.qtpl:137 qw422016.N().S(``) //line lib/promscrape/relabel_debug.qtpl:138 qw422016.E().S(label.Name) //line lib/promscrape/relabel_debug.qtpl:138 qw422016.N().S(`=`) //line lib/promscrape/relabel_debug.qtpl:138 qw422016.E().Q(label.Value) //line lib/promscrape/relabel_debug.qtpl:138 qw422016.N().S(``) //line lib/promscrape/relabel_debug.qtpl:139 } else { //line lib/promscrape/relabel_debug.qtpl:140 qw422016.E().S(label.Name) //line lib/promscrape/relabel_debug.qtpl:140 qw422016.N().S(`=`) //line lib/promscrape/relabel_debug.qtpl:140 qw422016.E().Q(label.Value) //line lib/promscrape/relabel_debug.qtpl:141 } //line lib/promscrape/relabel_debug.qtpl:142 if i < len(labelsList)-1 { //line lib/promscrape/relabel_debug.qtpl:142 qw422016.N().S(`,`) //line lib/promscrape/relabel_debug.qtpl:142 qw422016.N().S(` `) //line lib/promscrape/relabel_debug.qtpl:142 } //line lib/promscrape/relabel_debug.qtpl:143 } //line lib/promscrape/relabel_debug.qtpl:143 qw422016.N().S(`}`) //line lib/promscrape/relabel_debug.qtpl:145 } //line lib/promscrape/relabel_debug.qtpl:145 func writelabelsWithHighlight(qq422016 qtio422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) { //line lib/promscrape/relabel_debug.qtpl:145 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promscrape/relabel_debug.qtpl:145 streamlabelsWithHighlight(qw422016, labels, highlight, color) //line lib/promscrape/relabel_debug.qtpl:145 qt422016.ReleaseWriter(qw422016) //line lib/promscrape/relabel_debug.qtpl:145 } //line lib/promscrape/relabel_debug.qtpl:145 func labelsWithHighlight(labels *promutils.Labels, highlight map[string]struct{}, color string) string { //line lib/promscrape/relabel_debug.qtpl:145 qb422016 := qt422016.AcquireByteBuffer() //line lib/promscrape/relabel_debug.qtpl:145 writelabelsWithHighlight(qb422016, labels, highlight, color) //line lib/promscrape/relabel_debug.qtpl:145 qs422016 := string(qb422016.B) //line lib/promscrape/relabel_debug.qtpl:145 qt422016.ReleaseByteBuffer(qb422016) //line lib/promscrape/relabel_debug.qtpl:145 return qs422016 //line lib/promscrape/relabel_debug.qtpl:145 } //line lib/promscrape/relabel_debug.qtpl:147 func streammustFormatLabels(qw422016 *qt422016.Writer, s string) { //line lib/promscrape/relabel_debug.qtpl:148 labels := promutils.MustNewLabelsFromString(s) //line lib/promscrape/relabel_debug.qtpl:149 streamlabelsWithHighlight(qw422016, labels, nil, "") //line lib/promscrape/relabel_debug.qtpl:150 } //line lib/promscrape/relabel_debug.qtpl:150 func writemustFormatLabels(qq422016 qtio422016.Writer, s string) { //line lib/promscrape/relabel_debug.qtpl:150 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promscrape/relabel_debug.qtpl:150 streammustFormatLabels(qw422016, s) //line lib/promscrape/relabel_debug.qtpl:150 qt422016.ReleaseWriter(qw422016) //line lib/promscrape/relabel_debug.qtpl:150 } //line lib/promscrape/relabel_debug.qtpl:150 func mustFormatLabels(s string) string { //line lib/promscrape/relabel_debug.qtpl:150 qb422016 := qt422016.AcquireByteBuffer() //line lib/promscrape/relabel_debug.qtpl:150 writemustFormatLabels(qb422016, s) //line lib/promscrape/relabel_debug.qtpl:150 qs422016 := string(qb422016.B) //line lib/promscrape/relabel_debug.qtpl:150 qt422016.ReleaseByteBuffer(qb422016) //line lib/promscrape/relabel_debug.qtpl:150 return qs422016 //line lib/promscrape/relabel_debug.qtpl:150 }