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:13
+ StreamRelabelDebugStepsHTML(qw422016, targetURL, targetID, dss, metric, relabelConfigs, err)
+//line lib/promrelabel/debug.qtpl:14
}
-//line lib/promrelabel/debug.qtpl:34
- qw422016.N().S(`
`)
+//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(``)
+//line lib/promrelabel/debug.qtpl:21
+ htmlcomponents.StreamCommonHeader(qw422016)
+//line lib/promrelabel/debug.qtpl:21
+ qw422016.N().S(`
Metric relabel debug`)
+//line lib/promrelabel/debug.qtpl:35
+ htmlcomponents.StreamNavbar(qw422016)
+//line lib/promrelabel/debug.qtpl:35
+ qw422016.N().S(`
Relabeling docs`)
//line lib/promrelabel/debug.qtpl:37
- if err != nil {
-//line lib/promrelabel/debug.qtpl:38
- htmlcomponents.StreamErrorNotification(qw422016, err)
+ qw422016.N().S(` `)
//line lib/promrelabel/debug.qtpl:39
- }
+ if targetURL != "" {
//line lib/promrelabel/debug.qtpl:39
- qw422016.N().S(`
`)
-//line lib/promrelabel/debug.qtpl:62
+//line lib/promrelabel/debug.qtpl:71
}
-//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
+//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
qw422016 := qt422016.AcquireWriter(qq422016)
-//line lib/promrelabel/debug.qtpl:62
- StreamRelabelDebugSteps(qw422016, targetURL, targetID, dss, metric, relabelConfigs, err)
-//line lib/promrelabel/debug.qtpl:62
+//line lib/promrelabel/debug.qtpl:71
+ StreamRelabelDebugStepsHTML(qw422016, targetURL, targetID, dss, metric, relabelConfigs, err)
+//line lib/promrelabel/debug.qtpl:71
qt422016.ReleaseWriter(qw422016)
-//line lib/promrelabel/debug.qtpl:62
+//line lib/promrelabel/debug.qtpl:71
}
-//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
+//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
qb422016 := qt422016.AcquireByteBuffer()
-//line lib/promrelabel/debug.qtpl:62
- WriteRelabelDebugSteps(qb422016, targetURL, targetID, dss, metric, relabelConfigs, err)
-//line lib/promrelabel/debug.qtpl:62
+//line lib/promrelabel/debug.qtpl:71
+ WriteRelabelDebugStepsHTML(qb422016, targetURL, targetID, dss, metric, relabelConfigs, err)
+//line lib/promrelabel/debug.qtpl:71
qs422016 := string(qb422016.B)
-//line lib/promrelabel/debug.qtpl:62
+//line lib/promrelabel/debug.qtpl:71
qt422016.ReleaseByteBuffer(qb422016)
-//line lib/promrelabel/debug.qtpl:62
+//line lib/promrelabel/debug.qtpl:71
return qs422016
-//line lib/promrelabel/debug.qtpl:62
+//line lib/promrelabel/debug.qtpl:71
}
-//line lib/promrelabel/debug.qtpl:64
+//line lib/promrelabel/debug.qtpl:73
func streamrelabelDebugFormInputs(qw422016 *qt422016.Writer, metric, relabelConfigs string) {
-//line lib/promrelabel/debug.qtpl:64
+//line lib/promrelabel/debug.qtpl:73
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
+ qw422016.E().S(relabelConfigs)
+//line lib/promrelabel/debug.qtpl:76
+ qw422016.N().S(`
Labels:
`)
+//line lib/promrelabel/debug.qtpl:83
+}
+
+//line lib/promrelabel/debug.qtpl:83
+func writerelabelDebugFormInputs(qq422016 qtio422016.Writer, metric, relabelConfigs string) {
+//line lib/promrelabel/debug.qtpl:83
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line lib/promrelabel/debug.qtpl:83
+ streamrelabelDebugFormInputs(qw422016, metric, relabelConfigs)
+//line lib/promrelabel/debug.qtpl:83
+ qt422016.ReleaseWriter(qw422016)
+//line lib/promrelabel/debug.qtpl:83
+}
+
+//line lib/promrelabel/debug.qtpl:83
+func relabelDebugFormInputs(metric, relabelConfigs string) string {
+//line lib/promrelabel/debug.qtpl:83
+ qb422016 := qt422016.AcquireByteBuffer()
+//line lib/promrelabel/debug.qtpl:83
+ writerelabelDebugFormInputs(qb422016, metric, relabelConfigs)
+//line lib/promrelabel/debug.qtpl:83
+ qs422016 := string(qb422016.B)
+//line lib/promrelabel/debug.qtpl:83
+ qt422016.ReleaseByteBuffer(qb422016)
+//line lib/promrelabel/debug.qtpl:83
+ return qs422016
+//line lib/promrelabel/debug.qtpl:83
+}
+
+//line lib/promrelabel/debug.qtpl:85
func streamrelabelDebugSteps(qw422016 *qt422016.Writer, dss []DebugStep, targetURL, targetID string) {
-//line lib/promrelabel/debug.qtpl:77
+//line lib/promrelabel/debug.qtpl:86
if len(dss) > 0 {
-//line lib/promrelabel/debug.qtpl:77
+//line lib/promrelabel/debug.qtpl:86
qw422016.N().S(`
Original labels: `)
-//line lib/promrelabel/debug.qtpl:79
+//line lib/promrelabel/debug.qtpl:88
streammustFormatLabels(qw422016, dss[0].In)
-//line lib/promrelabel/debug.qtpl:79
+//line lib/promrelabel/debug.qtpl:88
qw422016.N().S(`
`)
-//line lib/promrelabel/debug.qtpl:81
+//line lib/promrelabel/debug.qtpl:90
}
-//line lib/promrelabel/debug.qtpl:81
+//line lib/promrelabel/debug.qtpl:90
qw422016.N().S(`
Step | Relabeling Rule | Input Labels | Output labels |
`)
-//line lib/promrelabel/debug.qtpl:92
+//line lib/promrelabel/debug.qtpl:101
for i, ds := range dss {
-//line lib/promrelabel/debug.qtpl:94
+//line lib/promrelabel/debug.qtpl:103
inLabels := promutils.MustNewLabelsFromString(ds.In)
outLabels := promutils.MustNewLabelsFromString(ds.Out)
changedLabels := getChangedLabelNames(inLabels, outLabels)
-//line lib/promrelabel/debug.qtpl:97
+//line lib/promrelabel/debug.qtpl:106
qw422016.N().S(``)
-//line lib/promrelabel/debug.qtpl:99
+//line lib/promrelabel/debug.qtpl:108
qw422016.N().D(i)
-//line lib/promrelabel/debug.qtpl:99
+//line lib/promrelabel/debug.qtpl:108
qw422016.N().S(` | `)
-//line lib/promrelabel/debug.qtpl:100
+//line lib/promrelabel/debug.qtpl:109
qw422016.E().S(ds.Rule)
-//line lib/promrelabel/debug.qtpl:100
+//line lib/promrelabel/debug.qtpl:109
qw422016.N().S(` | `)
-//line lib/promrelabel/debug.qtpl:103
+//line lib/promrelabel/debug.qtpl:112
streamlabelsWithHighlight(qw422016, inLabels, changedLabels, "red")
-//line lib/promrelabel/debug.qtpl:103
+//line lib/promrelabel/debug.qtpl:112
qw422016.N().S(` | `)
-//line lib/promrelabel/debug.qtpl:108
+//line lib/promrelabel/debug.qtpl:117
streamlabelsWithHighlight(qw422016, outLabels, changedLabels, "blue")
-//line lib/promrelabel/debug.qtpl:108
+//line lib/promrelabel/debug.qtpl:117
qw422016.N().S(` |
`)
-//line lib/promrelabel/debug.qtpl:112
- }
-//line lib/promrelabel/debug.qtpl:112
- 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(`
`)
-//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:121
+ qw422016.N().S(``)
+//line lib/promrelabel/debug.qtpl:124
+ if len(dss) > 0 {
+//line lib/promrelabel/debug.qtpl:124
+ qw422016.N().S(`
Resulting labels: `)
+//line lib/promrelabel/debug.qtpl:126
+ streammustFormatLabels(qw422016, dss[len(dss)-1].Out)
+//line lib/promrelabel/debug.qtpl:126
+ qw422016.N().S(``)
+//line lib/promrelabel/debug.qtpl:127
+ if targetURL != "" {
+//line lib/promrelabel/debug.qtpl:127
+ qw422016.N().S(`
Target URL:`)
//line lib/promrelabel/debug.qtpl:129
-}
-
+ qw422016.N().S(` `)
//line lib/promrelabel/debug.qtpl:129
-func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []DebugStep, targetURL, targetID string) {
+ qw422016.N().S(`
`)
//line lib/promrelabel/debug.qtpl:129
- qt422016.ReleaseWriter(qw422016)
+ qw422016.E().S(targetURL)
//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
-}
-
+ qw422016.N().S(``)
+//line lib/promrelabel/debug.qtpl:130
+ if targetID != "" {
//line lib/promrelabel/debug.qtpl:131
-func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
+ qw422016.N().S(` `)
+//line lib/promrelabel/debug.qtpl:131
+ qw422016.N().S(`(
response)`)
//line lib/promrelabel/debug.qtpl:133
+ }
+//line lib/promrelabel/debug.qtpl:133
+ qw422016.N().S(`
`)
+//line lib/promrelabel/debug.qtpl:135
+ }
+//line lib/promrelabel/debug.qtpl:135
+ qw422016.N().S(`
`)
+//line lib/promrelabel/debug.qtpl:137
+ }
+//line lib/promrelabel/debug.qtpl:138
+}
+
+//line lib/promrelabel/debug.qtpl:138
+func writerelabelDebugSteps(qq422016 qtio422016.Writer, dss []DebugStep, targetURL, targetID string) {
+//line lib/promrelabel/debug.qtpl:138
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line lib/promrelabel/debug.qtpl:138
+ streamrelabelDebugSteps(qw422016, dss, targetURL, targetID)
+//line lib/promrelabel/debug.qtpl:138
+ qt422016.ReleaseWriter(qw422016)
+//line lib/promrelabel/debug.qtpl:138
+}
+
+//line lib/promrelabel/debug.qtpl:138
+func relabelDebugSteps(dss []DebugStep, targetURL, targetID string) string {
+//line lib/promrelabel/debug.qtpl:138
+ qb422016 := qt422016.AcquireByteBuffer()
+//line lib/promrelabel/debug.qtpl:138
+ writerelabelDebugSteps(qb422016, dss, targetURL, targetID)
+//line lib/promrelabel/debug.qtpl:138
+ qs422016 := string(qb422016.B)
+//line lib/promrelabel/debug.qtpl:138
+ qt422016.ReleaseByteBuffer(qb422016)
+//line lib/promrelabel/debug.qtpl:138
+ return qs422016
+//line lib/promrelabel/debug.qtpl:138
+}
+
+//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
+ qw422016.N().Q(string(mustFormatLabels(dss[0].In)))
+//line lib/promrelabel/debug.qtpl:148
+ qw422016.N().S(`,"resultingLabels":`)
+//line lib/promrelabel/debug.qtpl:149
+ qw422016.N().Q(string(mustFormatLabels(dss[len(dss)-1].Out)))
+//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
+func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
+//line lib/promrelabel/debug.qtpl:172
labelsList := labels.GetLabels()
metricName := ""
for i, label := range labelsList {
@@ -306,137 +442,137 @@ func streamlabelsWithHighlight(qw422016 *qt422016.Writer, labels *promutils.Labe
}
}
-//line lib/promrelabel/debug.qtpl:143
+//line lib/promrelabel/debug.qtpl:182
if metricName != "" {
-//line lib/promrelabel/debug.qtpl:144
+//line lib/promrelabel/debug.qtpl:183
if _, ok := highlight["__name__"]; ok {
-//line lib/promrelabel/debug.qtpl:144
+//line lib/promrelabel/debug.qtpl:183
qw422016.N().S(`
`)
-//line lib/promrelabel/debug.qtpl:145
+//line lib/promrelabel/debug.qtpl:184
qw422016.E().S(metricName)
-//line lib/promrelabel/debug.qtpl:145
+//line lib/promrelabel/debug.qtpl:184
qw422016.N().S(``)
-//line lib/promrelabel/debug.qtpl:146
+//line lib/promrelabel/debug.qtpl:185
} else {
-//line lib/promrelabel/debug.qtpl:147
+//line lib/promrelabel/debug.qtpl:186
qw422016.E().S(metricName)
-//line lib/promrelabel/debug.qtpl:148
+//line lib/promrelabel/debug.qtpl:187
}
-//line lib/promrelabel/debug.qtpl:149
+//line lib/promrelabel/debug.qtpl:188
if len(labelsList) == 0 {
-//line lib/promrelabel/debug.qtpl:149
+//line lib/promrelabel/debug.qtpl:188
return
-//line lib/promrelabel/debug.qtpl:149
+//line lib/promrelabel/debug.qtpl:188
}
-//line lib/promrelabel/debug.qtpl:150
+//line lib/promrelabel/debug.qtpl:189
}
-//line lib/promrelabel/debug.qtpl:150
+//line lib/promrelabel/debug.qtpl:189
qw422016.N().S(`{`)
-//line lib/promrelabel/debug.qtpl:152
+//line lib/promrelabel/debug.qtpl:191
for i, label := range labelsList {
-//line lib/promrelabel/debug.qtpl:153
+//line lib/promrelabel/debug.qtpl:192
if _, ok := highlight[label.Name]; ok {
-//line lib/promrelabel/debug.qtpl:153
+//line lib/promrelabel/debug.qtpl:192
qw422016.N().S(`
`)
-//line lib/promrelabel/debug.qtpl:154
+//line lib/promrelabel/debug.qtpl:193
qw422016.E().S(label.Name)
-//line lib/promrelabel/debug.qtpl:154
+//line lib/promrelabel/debug.qtpl:193
qw422016.N().S(`=`)
-//line lib/promrelabel/debug.qtpl:154
+//line lib/promrelabel/debug.qtpl:193
qw422016.E().Q(label.Value)
-//line lib/promrelabel/debug.qtpl:154
+//line lib/promrelabel/debug.qtpl:193
qw422016.N().S(``)
-//line lib/promrelabel/debug.qtpl:155
+//line lib/promrelabel/debug.qtpl:194
} else {
-//line lib/promrelabel/debug.qtpl:156
+//line lib/promrelabel/debug.qtpl:195
qw422016.E().S(label.Name)
-//line lib/promrelabel/debug.qtpl:156
+//line lib/promrelabel/debug.qtpl:195
qw422016.N().S(`=`)
-//line lib/promrelabel/debug.qtpl:156
+//line lib/promrelabel/debug.qtpl:195
qw422016.E().Q(label.Value)
-//line lib/promrelabel/debug.qtpl:157
+//line lib/promrelabel/debug.qtpl:196
}
-//line lib/promrelabel/debug.qtpl:158
+//line lib/promrelabel/debug.qtpl:197
if i < len(labelsList)-1 {
-//line lib/promrelabel/debug.qtpl:158
+//line lib/promrelabel/debug.qtpl:197
qw422016.N().S(`,`)
-//line lib/promrelabel/debug.qtpl:158
+//line lib/promrelabel/debug.qtpl:197
qw422016.N().S(` `)
-//line lib/promrelabel/debug.qtpl:158
+//line lib/promrelabel/debug.qtpl:197
}
-//line lib/promrelabel/debug.qtpl:159
+//line lib/promrelabel/debug.qtpl:198
}
-//line lib/promrelabel/debug.qtpl:159
+//line lib/promrelabel/debug.qtpl:198
qw422016.N().S(`}`)
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
}
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
func writelabelsWithHighlight(qq422016 qtio422016.Writer, labels *promutils.Labels, highlight map[string]struct{}, color string) {
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
qw422016 := qt422016.AcquireWriter(qq422016)
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
streamlabelsWithHighlight(qw422016, labels, highlight, color)
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
qt422016.ReleaseWriter(qw422016)
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
}
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
func labelsWithHighlight(labels *promutils.Labels, highlight map[string]struct{}, color string) string {
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
qb422016 := qt422016.AcquireByteBuffer()
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
writelabelsWithHighlight(qb422016, labels, highlight, color)
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
qs422016 := string(qb422016.B)
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
qt422016.ReleaseByteBuffer(qb422016)
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
return qs422016
-//line lib/promrelabel/debug.qtpl:161
+//line lib/promrelabel/debug.qtpl:200
}
-//line lib/promrelabel/debug.qtpl:163
+//line lib/promrelabel/debug.qtpl:202
func streammustFormatLabels(qw422016 *qt422016.Writer, s string) {
-//line lib/promrelabel/debug.qtpl:164
+//line lib/promrelabel/debug.qtpl:203
labels := promutils.MustNewLabelsFromString(s)
-//line lib/promrelabel/debug.qtpl:165
+//line lib/promrelabel/debug.qtpl:204
streamlabelsWithHighlight(qw422016, labels, nil, "")
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
}
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
func writemustFormatLabels(qq422016 qtio422016.Writer, s string) {
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
qw422016 := qt422016.AcquireWriter(qq422016)
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
streammustFormatLabels(qw422016, s)
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
qt422016.ReleaseWriter(qw422016)
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
}
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
func mustFormatLabels(s string) string {
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
qb422016 := qt422016.AcquireByteBuffer()
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
writemustFormatLabels(qb422016, s)
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
qs422016 := string(qb422016.B)
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
qt422016.ReleaseByteBuffer(qb422016)
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
return qs422016
-//line lib/promrelabel/debug.qtpl:166
+//line lib/promrelabel/debug.qtpl:205
}
diff --git a/lib/promscrape/relabel_debug.go b/lib/promscrape/relabel_debug.go
index f6b142e78..cc119a671 100644
--- a/lib/promscrape/relabel_debug.go
+++ b/lib/promscrape/relabel_debug.go
@@ -12,8 +12,13 @@ func WriteMetricRelabelDebug(w http.ResponseWriter, r *http.Request) {
targetID := r.FormValue("id")
metric := r.FormValue("metric")
relabelConfigs := r.FormValue("relabel_configs")
+ format := r.FormValue("format")
var err error
+ if format == "json" {
+ w.Header().Set("Content-Type", "application/json")
+ }
+
if metric == "" && relabelConfigs == "" && targetID != "" {
pcs, labels, ok := getMetricRelabelContextByTargetID(targetID)
if !ok {
@@ -24,7 +29,7 @@ func WriteMetricRelabelDebug(w http.ResponseWriter, r *http.Request) {
relabelConfigs = pcs.String()
}
}
- promrelabel.WriteMetricRelabelDebug(w, targetID, metric, relabelConfigs, err)
+ promrelabel.WriteMetricRelabelDebug(w, targetID, metric, relabelConfigs, format, err)
}
// WriteTargetRelabelDebug generates response for /target-relabel-debug page
@@ -32,6 +37,7 @@ func WriteTargetRelabelDebug(w http.ResponseWriter, r *http.Request) {
targetID := r.FormValue("id")
metric := r.FormValue("metric")
relabelConfigs := r.FormValue("relabel_configs")
+ format := r.FormValue("format")
var err error
if metric == "" && relabelConfigs == "" && targetID != "" {
@@ -44,5 +50,5 @@ func WriteTargetRelabelDebug(w http.ResponseWriter, r *http.Request) {
relabelConfigs = pcs.String()
}
}
- promrelabel.WriteTargetRelabelDebug(w, targetID, metric, relabelConfigs, err)
+ promrelabel.WriteTargetRelabelDebug(w, targetID, metric, relabelConfigs, format, err)
}