// 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 StreamRelabelDebugSteps(qw422016 *qt422016.Writer, targetURL string, targetID string, 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:26 htmlcomponents.StreamNavbar(qw422016) //line lib/promrelabel/debug.qtpl:26 qw422016.N().S(`
Relabeling docs`) //line lib/promrelabel/debug.qtpl:28 qw422016.N().S(` `) //line lib/promrelabel/debug.qtpl:30 if targetURL != "" { //line lib/promrelabel/debug.qtpl:30 qw422016.N().S(`Metric relabel debug`) //line lib/promrelabel/debug.qtpl:32 } else { //line lib/promrelabel/debug.qtpl:32 qw422016.N().S(`Target relabel debug`) //line lib/promrelabel/debug.qtpl:34 } //line lib/promrelabel/debug.qtpl:34 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:37 if err != nil { //line lib/promrelabel/debug.qtpl:38 htmlcomponents.StreamErrorNotification(qw422016, err) //line lib/promrelabel/debug.qtpl:39 } //line lib/promrelabel/debug.qtpl:39 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:43 streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs) //line lib/promrelabel/debug.qtpl:44 if targetID != "" { //line lib/promrelabel/debug.qtpl:44 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:46 } //line lib/promrelabel/debug.qtpl:46 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:48 if targetID != "" { //line lib/promrelabel/debug.qtpl:48 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:50 } //line lib/promrelabel/debug.qtpl:50 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:56 streamrelabelDebugSteps(qw422016, dss, targetURL, targetID) //line lib/promrelabel/debug.qtpl:56 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:62 } //line lib/promrelabel/debug.qtpl:62 func WriteRelabelDebugSteps(qq422016 qtio422016.Writer, targetURL string, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) { //line lib/promrelabel/debug.qtpl:62 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promrelabel/debug.qtpl:62 StreamRelabelDebugSteps(qw422016, targetURL, targetID, dss, metric, relabelConfigs, err) //line lib/promrelabel/debug.qtpl:62 qt422016.ReleaseWriter(qw422016) //line lib/promrelabel/debug.qtpl:62 } //line lib/promrelabel/debug.qtpl:62 func RelabelDebugSteps(targetURL string, targetID string, dss []DebugStep, metric, relabelConfigs string, err error) string { //line lib/promrelabel/debug.qtpl:62 qb422016 := qt422016.AcquireByteBuffer() //line lib/promrelabel/debug.qtpl:62 WriteRelabelDebugSteps(qb422016, targetURL, targetID, dss, metric, relabelConfigs, err) //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 streamrelabelDebugFormInputs(qw422016 *qt422016.Writer, metric, relabelConfigs string) { //line lib/promrelabel/debug.qtpl:64 qw422016.N().S(`
Relabel configs:
Labels:
`) //line lib/promrelabel/debug.qtpl:74 } //line lib/promrelabel/debug.qtpl:74 func writerelabelDebugFormInputs(qq422016 qtio422016.Writer, metric, relabelConfigs string) { //line lib/promrelabel/debug.qtpl:74 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promrelabel/debug.qtpl:74 streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs) //line lib/promrelabel/debug.qtpl:74 qt422016.ReleaseWriter(qw422016) //line lib/promrelabel/debug.qtpl:74 } //line lib/promrelabel/debug.qtpl:74 func relabelDebugFormInputs(metric, relabelConfigs string) string { //line lib/promrelabel/debug.qtpl:74 qb422016 := qt422016.AcquireByteBuffer() //line lib/promrelabel/debug.qtpl:74 writerelabelDebugFormInputs(qb422016, metric, relabelConfigs) //line lib/promrelabel/debug.qtpl:74 qs422016 := string(qb422016.B) //line lib/promrelabel/debug.qtpl:74 qt422016.ReleaseByteBuffer(qb422016) //line lib/promrelabel/debug.qtpl:74 return qs422016 //line lib/promrelabel/debug.qtpl:74 } //line lib/promrelabel/debug.qtpl:76 func streamrelabelDebugSteps(qw422016 *qt422016.Writer, dss []DebugStep, targetURL, targetID string) { //line lib/promrelabel/debug.qtpl:77 if len(dss) > 0 { //line lib/promrelabel/debug.qtpl:77 qw422016.N().S(`
Original labels: `) //line lib/promrelabel/debug.qtpl:79 streammustFormatLabels(qw422016, dss[0].In) //line lib/promrelabel/debug.qtpl:79 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:81 } //line lib/promrelabel/debug.qtpl:81 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:92 for i, ds := range dss { //line lib/promrelabel/debug.qtpl:94 inLabels := promutils.MustNewLabelsFromString(ds.In) outLabels := promutils.MustNewLabelsFromString(ds.Out) changedLabels := getChangedLabelNames(inLabels, outLabels) //line lib/promrelabel/debug.qtpl:97 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:112 } //line lib/promrelabel/debug.qtpl:112 qw422016.N().S(`
StepRelabeling RuleInput LabelsOutput labels
`) //line lib/promrelabel/debug.qtpl:99 qw422016.N().D(i) //line lib/promrelabel/debug.qtpl:99 qw422016.N().S(`
`)
//line lib/promrelabel/debug.qtpl:100
		qw422016.E().S(ds.Rule)
//line lib/promrelabel/debug.qtpl:100
		qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:103 streamlabelsWithHighlight(qw422016, inLabels, changedLabels, "red") //line lib/promrelabel/debug.qtpl:103 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:108 streamlabelsWithHighlight(qw422016, outLabels, changedLabels, "blue") //line lib/promrelabel/debug.qtpl:108 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:115 if len(dss) > 0 { //line lib/promrelabel/debug.qtpl:115 qw422016.N().S(`
Resulting labels: `) //line lib/promrelabel/debug.qtpl:117 streammustFormatLabels(qw422016, dss[len(dss)-1].Out) //line lib/promrelabel/debug.qtpl:117 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:118 if targetURL != "" { //line lib/promrelabel/debug.qtpl:118 qw422016.N().S(`
Target URL:`) //line lib/promrelabel/debug.qtpl:120 qw422016.N().S(` `) //line lib/promrelabel/debug.qtpl:120 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:120 qw422016.E().S(targetURL) //line lib/promrelabel/debug.qtpl:120 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:121 if targetID != "" { //line lib/promrelabel/debug.qtpl:122 qw422016.N().S(` `) //line lib/promrelabel/debug.qtpl:122 qw422016.N().S(`(response)`) //line lib/promrelabel/debug.qtpl:124 } //line lib/promrelabel/debug.qtpl:124 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:126 } //line lib/promrelabel/debug.qtpl:126 qw422016.N().S(`
`) //line lib/promrelabel/debug.qtpl:128 } //line lib/promrelabel/debug.qtpl:129 } //line lib/promrelabel/debug.qtpl:129 func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []DebugStep, targetURL, targetID string) { //line lib/promrelabel/debug.qtpl:129 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promrelabel/debug.qtpl:129 streamrelabelDebugSteps(qw422016, dss, targetURL, targetID) //line lib/promrelabel/debug.qtpl:129 qt422016.ReleaseWriter(qw422016) //line lib/promrelabel/debug.qtpl:129 } //line lib/promrelabel/debug.qtpl:129 func relabelDebugSteps(dss []DebugStep, targetURL, targetID string) string { //line lib/promrelabel/debug.qtpl:129 qb422016 := qt422016.AcquireByteBuffer() //line lib/promrelabel/debug.qtpl:129 writerelabelDebugSteps(qb422016, dss, targetURL, targetID) //line lib/promrelabel/debug.qtpl:129 qs422016 := string(qb422016.B) //line lib/promrelabel/debug.qtpl:129 qt422016.ReleaseByteBuffer(qb422016) //line lib/promrelabel/debug.qtpl:129 return qs422016 //line lib/promrelabel/debug.qtpl:129 } //line lib/promrelabel/debug.qtpl:131 func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) { //line lib/promrelabel/debug.qtpl:133 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:143 if metricName != "" { //line lib/promrelabel/debug.qtpl:144 if _, ok := highlight["__name__"]; ok { //line lib/promrelabel/debug.qtpl:144 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:145 qw422016.E().S(metricName) //line lib/promrelabel/debug.qtpl:145 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:146 } else { //line lib/promrelabel/debug.qtpl:147 qw422016.E().S(metricName) //line lib/promrelabel/debug.qtpl:148 } //line lib/promrelabel/debug.qtpl:149 if len(labelsList) == 0 { //line lib/promrelabel/debug.qtpl:149 return //line lib/promrelabel/debug.qtpl:149 } //line lib/promrelabel/debug.qtpl:150 } //line lib/promrelabel/debug.qtpl:150 qw422016.N().S(`{`) //line lib/promrelabel/debug.qtpl:152 for i, label := range labelsList { //line lib/promrelabel/debug.qtpl:153 if _, ok := highlight[label.Name]; ok { //line lib/promrelabel/debug.qtpl:153 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:154 qw422016.E().S(label.Name) //line lib/promrelabel/debug.qtpl:154 qw422016.N().S(`=`) //line lib/promrelabel/debug.qtpl:154 qw422016.E().Q(label.Value) //line lib/promrelabel/debug.qtpl:154 qw422016.N().S(``) //line lib/promrelabel/debug.qtpl:155 } else { //line lib/promrelabel/debug.qtpl:156 qw422016.E().S(label.Name) //line lib/promrelabel/debug.qtpl:156 qw422016.N().S(`=`) //line lib/promrelabel/debug.qtpl:156 qw422016.E().Q(label.Value) //line lib/promrelabel/debug.qtpl:157 } //line lib/promrelabel/debug.qtpl:158 if i < len(labelsList)-1 { //line lib/promrelabel/debug.qtpl:158 qw422016.N().S(`,`) //line lib/promrelabel/debug.qtpl:158 qw422016.N().S(` `) //line lib/promrelabel/debug.qtpl:158 } //line lib/promrelabel/debug.qtpl:159 } //line lib/promrelabel/debug.qtpl:159 qw422016.N().S(`}`) //line lib/promrelabel/debug.qtpl:161 } //line lib/promrelabel/debug.qtpl:161 func writelabelsWithHighlight(qq422016 qtio422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) { //line lib/promrelabel/debug.qtpl:161 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promrelabel/debug.qtpl:161 streamlabelsWithHighlight(qw422016, labels, highlight, color) //line lib/promrelabel/debug.qtpl:161 qt422016.ReleaseWriter(qw422016) //line lib/promrelabel/debug.qtpl:161 } //line lib/promrelabel/debug.qtpl:161 func labelsWithHighlight(labels *promutils.Labels, highlight map[string]struct{}, color string) string { //line lib/promrelabel/debug.qtpl:161 qb422016 := qt422016.AcquireByteBuffer() //line lib/promrelabel/debug.qtpl:161 writelabelsWithHighlight(qb422016, labels, highlight, color) //line lib/promrelabel/debug.qtpl:161 qs422016 := string(qb422016.B) //line lib/promrelabel/debug.qtpl:161 qt422016.ReleaseByteBuffer(qb422016) //line lib/promrelabel/debug.qtpl:161 return qs422016 //line lib/promrelabel/debug.qtpl:161 } //line lib/promrelabel/debug.qtpl:163 func streammustFormatLabels(qw422016 *qt422016.Writer, s string) { //line lib/promrelabel/debug.qtpl:164 labels := promutils.MustNewLabelsFromString(s) //line lib/promrelabel/debug.qtpl:165 streamlabelsWithHighlight(qw422016, labels, nil, "") //line lib/promrelabel/debug.qtpl:166 } //line lib/promrelabel/debug.qtpl:166 func writemustFormatLabels(qq422016 qtio422016.Writer, s string) { //line lib/promrelabel/debug.qtpl:166 qw422016 := qt422016.AcquireWriter(qq422016) //line lib/promrelabel/debug.qtpl:166 streammustFormatLabels(qw422016, s) //line lib/promrelabel/debug.qtpl:166 qt422016.ReleaseWriter(qw422016) //line lib/promrelabel/debug.qtpl:166 } //line lib/promrelabel/debug.qtpl:166 func mustFormatLabels(s string) string { //line lib/promrelabel/debug.qtpl:166 qb422016 := qt422016.AcquireByteBuffer() //line lib/promrelabel/debug.qtpl:166 writemustFormatLabels(qb422016, s) //line lib/promrelabel/debug.qtpl:166 qs422016 := string(qb422016.B) //line lib/promrelabel/debug.qtpl:166 qt422016.ReleaseByteBuffer(qb422016) //line lib/promrelabel/debug.qtpl:166 return qs422016 //line lib/promrelabel/debug.qtpl:166 }