diff --git a/lib/promscrape/targets_response.qtpl b/lib/promscrape/targets_response.qtpl index 448012c73..72a445f91 100644 --- a/lib/promscrape/targets_response.qtpl +++ b/lib/promscrape/targets_response.qtpl @@ -116,9 +116,12 @@ job={%q= jobName %} (0/0 up) {% endfunc %} {% func formatLabel(labels []prompbmarshal.Label) %} -{% for _, label := range labels %} - {%s label.Name %}={%q label.Value %} {% space %} -{% endfor %} +{ + {% for i, label := range labels %} + {%s label.Name %}={%q label.Value %} + {% if i+1 < len(labels) %},{% endif %} + {% endfor %} +} {% endfunc %} {% endstripspace %} diff --git a/lib/promscrape/targets_response.qtpl.go b/lib/promscrape/targets_response.qtpl.go index 334d1873f..1a2015e24 100644 --- a/lib/promscrape/targets_response.qtpl.go +++ b/lib/promscrape/targets_response.qtpl.go @@ -359,43 +359,51 @@ func TargetsResponseHTML(jts []jobTargetsStatuses, emptyJobs []string, redirectP //line lib/promscrape/targets_response.qtpl:118 func streamformatLabel(qw422016 *qt422016.Writer, labels []prompbmarshal.Label) { -//line lib/promscrape/targets_response.qtpl:119 - for _, label := range labels { +//line lib/promscrape/targets_response.qtpl:118 + qw422016.N().S(`{`) //line lib/promscrape/targets_response.qtpl:120 - qw422016.E().S(label.Name) -//line lib/promscrape/targets_response.qtpl:120 - qw422016.N().S(`=`) -//line lib/promscrape/targets_response.qtpl:120 - qw422016.E().Q(label.Value) -//line lib/promscrape/targets_response.qtpl:120 - qw422016.N().S(` `) + for i, label := range labels { //line lib/promscrape/targets_response.qtpl:121 + qw422016.E().S(label.Name) +//line lib/promscrape/targets_response.qtpl:121 + qw422016.N().S(`=`) +//line lib/promscrape/targets_response.qtpl:121 + qw422016.E().Q(label.Value) +//line lib/promscrape/targets_response.qtpl:122 + if i+1 < len(labels) { +//line lib/promscrape/targets_response.qtpl:122 + qw422016.N().S(`,`) +//line lib/promscrape/targets_response.qtpl:122 + } +//line lib/promscrape/targets_response.qtpl:123 } -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:123 + qw422016.N().S(`}`) +//line lib/promscrape/targets_response.qtpl:125 } -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 func writeformatLabel(qq422016 qtio422016.Writer, labels []prompbmarshal.Label) { -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 streamformatLabel(qw422016, labels) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 } -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 func formatLabel(labels []prompbmarshal.Label) string { -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 writeformatLabel(qb422016, labels) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 qs422016 := string(qb422016.B) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 return qs422016 -//line lib/promscrape/targets_response.qtpl:122 +//line lib/promscrape/targets_response.qtpl:125 }