From 324a3c52883a4a26d55cb8f5f29b7d8a0d5b820e Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 20 Jul 2023 19:14:30 -0700 Subject: [PATCH] lib/promscrape: follow-up after 6aa50ca954a44bcf87b0a62a92526f758155dba7 - Improve docs - Hide `debug relabeling` column when -promscrape.dropOriginalLabels command-line flag is set - Inline the code from the added template functions, since the code is harder to follow with the template functions, especially when these functions have misleading names. Also, these functions are used only in one place, e.g. they do not reduce the amounts of code. - Hide `click to show original labels` title at `labels` column when original labels aren't available. - Show the reason on whey original labels aren't available at /service-discovery page. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4597 --- app/vmagent/README.md | 13 +- docs/CHANGELOG.md | 2 +- docs/vmagent.md | 13 +- lib/promscrape/targetstatus.go | 7 +- lib/promscrape/targetstatus.qtpl | 86 ++- lib/promscrape/targetstatus.qtpl.go | 956 ++++++++++++---------------- 6 files changed, 456 insertions(+), 621 deletions(-) diff --git a/app/vmagent/README.md b/app/vmagent/README.md index fd1d794e0f..c8418e9111 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -463,8 +463,9 @@ with [additional enhancements](#relabeling-enhancements). The relabeling can be This relabeling is used for modifying labels in discovered targets and for dropping unneeded targets. See [relabeling cookbook](https://docs.victoriametrics.com/relabeling.html) for details. - This relabeling can be debugged by clicking the `debug` link (the link is available only if `--promscrape.dropOriginalLabels=false`) at the corresponding target on the `http://vmagent:8429/targets` page + This relabeling can be debugged by clicking the `debug` link at the corresponding target on the `http://vmagent:8429/targets` page or on the `http://vmagent:8429/service-discovery` page. See [these docs](#relabel-debug) for details. + The link is unavailable if `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag. * At the `scrape_config -> metric_relabel_configs` section in `-promscrape.config` file. This relabeling is used for modifying labels in scraped metrics and for dropping unneeded metrics. @@ -644,19 +645,21 @@ provide the following tools for debugging target-level and metric-level relabeli - Target-level debugging (e.g. `relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs)) can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics) - and clicking the `debug target relabeling` link (the link is available only if `--promscrape.dropOriginalLabels=false`) at the target, which must be debugged. + and clicking the `debug target relabeling` link at the target, which must be debugged. + The link is unavailable if `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag. The opened page shows step-by-step results for the actual target relabeling rules applied to the discovered target labels. The page shows also the target URL generated after applying all the relabeling rules. The `http://vmagent:8429/targets` page shows only active targets. If you need to understand why some target is dropped during the relabeling, then navigate to `http://vmagent:8428/service-discovery` page (`http://victoriametrics:8428/service-discovery` for single-node VictoriaMetrics), find the dropped target - and click the `debug` link (the link is available only if `--promscrape.dropOriginalLabels=false`) there. The opened page shows step-by-step results for the actual relabeling rules, - which result to target drop. + and click the `debug` link there. The link is unavailable if `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag. + The opened page shows step-by-step results for the actual relabeling rules, which result to target drop. - Metric-level debugging (e.g. `metric_relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs) can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics) - and clicking the `debug metrics relabeling` link (the link is available only if `--promscrape.dropOriginalLabels=false`) at the target, which must be debugged. + and clicking the `debug metrics relabeling` link at the target, which must be debugged. + The link is unavailable if `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag. The opened page shows step-by-step results for the actual metric relabeling rules applied to the given target labels. ## Prometheus staleness markers diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7786fd0fda..5b2db0cbec 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -68,7 +68,7 @@ The following `tip` changes can be tested by building VictoriaMetrics components * BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert.html): correctly calculate evaluation time for rules. Before, there was a low probability for discrepancy between actual time and rules evaluation time if evaluation interval was lower than the execution time for rules within the group. * BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert.html): reset evaluation timestamp after modifying group interval. Before, there could have latency on rule evaluation time. * BUGFIX: vmselect: fix timestamp alignment for Prometheus querying API if time argument is less than 10m from the beginning of Unix epoch. -* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): hide `debug` links on the `/targets` page if `--promscrape.dropOriginalLabels` is enabled. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4597). +* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): do not show [relabel debug](https://docs.victoriametrics.com/vmagent.html#relabel-debug) links at the `/targets` page when `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag, since it has no the original labels needed for relabel debug. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4597). * BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): properly parse binary operations with reserved words on the right side such as `foo + (on{bar="baz"})`. Previously such queries could lead to panic. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4422). * BUGFIX: [Official Grafana dashboards for VictoriaMetrics](https://grafana.com/orgs/victoriametrics): display cache usage for all components on panel `Cache usage % by type` for cluster dashboard. Before, only vmstorage caches were shown. diff --git a/docs/vmagent.md b/docs/vmagent.md index d45f547076..bc25e2ab0f 100644 --- a/docs/vmagent.md +++ b/docs/vmagent.md @@ -474,8 +474,9 @@ with [additional enhancements](#relabeling-enhancements). The relabeling can be This relabeling is used for modifying labels in discovered targets and for dropping unneeded targets. See [relabeling cookbook](https://docs.victoriametrics.com/relabeling.html) for details. - This relabeling can be debugged by clicking the `debug` link (the link is available only if `--promscrape.dropOriginalLabels=false`) at the corresponding target on the `http://vmagent:8429/targets` page + This relabeling can be debugged by clicking the `debug` link at the corresponding target on the `http://vmagent:8429/targets` page or on the `http://vmagent:8429/service-discovery` page. See [these docs](#relabel-debug) for details. + The link is unavailable if `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag. * At the `scrape_config -> metric_relabel_configs` section in `-promscrape.config` file. This relabeling is used for modifying labels in scraped metrics and for dropping unneeded metrics. @@ -655,19 +656,21 @@ provide the following tools for debugging target-level and metric-level relabeli - Target-level debugging (e.g. `relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs)) can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics) - and clicking the `debug target relabeling` link (the link is available only if `--promscrape.dropOriginalLabels=false`) at the target, which must be debugged. + and clicking the `debug target relabeling` link at the target, which must be debugged. + The link is unavailable if `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag. The opened page shows step-by-step results for the actual target relabeling rules applied to the discovered target labels. The page shows also the target URL generated after applying all the relabeling rules. The `http://vmagent:8429/targets` page shows only active targets. If you need to understand why some target is dropped during the relabeling, then navigate to `http://vmagent:8428/service-discovery` page (`http://victoriametrics:8428/service-discovery` for single-node VictoriaMetrics), find the dropped target - and click the `debug` link (the link is available only if `--promscrape.dropOriginalLabels=false`) there. The opened page shows step-by-step results for the actual relabeling rules, - which result to target drop. + and click the `debug` link there. The link is unavailable if `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag. + The opened page shows step-by-step results for the actual relabeling rules, which result to target drop. - Metric-level debugging (e.g. `metric_relabel_configs` section at [scrape_configs](https://docs.victoriametrics.com/sd_configs.html#scrape_configs) can be performed by navigating to `http://vmagent:8429/targets` page (`http://victoriametrics:8428/targets` page for single-node VictoriaMetrics) - and clicking the `debug metrics relabeling` link (the link is available only if `--promscrape.dropOriginalLabels=false`) at the target, which must be debugged. + and clicking the `debug metrics relabeling` link at the target, which must be debugged. + The link is unavailable if `vmagent` runs with `-promscrape.dropOriginalLabels` command-line flag. The opened page shows step-by-step results for the actual metric relabeling rules applied to the given target labels. ## Prometheus staleness markers diff --git a/lib/promscrape/targetstatus.go b/lib/promscrape/targetstatus.go index 3d02f2a254..de1823364a 100644 --- a/lib/promscrape/targetstatus.go +++ b/lib/promscrape/targetstatus.go @@ -156,11 +156,6 @@ func (tsm *targetStatusMap) getScrapeWorkByTargetID(targetID string) *scrapeWork } func getLabelsID(labels *promutils.Labels) string { - // return empty string if OriginalLabels was dropped - // via flag --promscrape.dropOriginalLabels - if labels == nil { - return "" - } return fmt.Sprintf("%016x", uintptr(unsafe.Pointer(labels))) } @@ -397,6 +392,7 @@ func (tsm *targetStatusMap) getTargetsStatusByJob(filter *requestFilter) *target } dts := droppedTargetsMap.getTargetsList() return &targetsStatusResult{ + hasOriginalLabels: !*dropOriginalLabels, jobTargetsStatuses: jts, droppedTargets: dts, emptyJobs: emptyJobs, @@ -507,6 +503,7 @@ func getRequestFilter(r *http.Request) *requestFilter { } type targetsStatusResult struct { + hasOriginalLabels bool jobTargetsStatuses []*jobTargetsStatuses droppedTargets []droppedTarget emptyJobs []string diff --git a/lib/promscrape/targetstatus.qtpl b/lib/promscrape/targetstatus.qtpl index c822fc2533..97f822addf 100644 --- a/lib/promscrape/targetstatus.qtpl +++ b/lib/promscrape/targetstatus.qtpl @@ -180,7 +180,7 @@
{% for i, jts := range tsr.jobTargetsStatuses %} - {%= scrapeJobTargets(i, jts) %} + {%= scrapeJobTargets(i, jts, tsr.hasOriginalLabels) %} {% endfor %} {% for i, jobName := range tsr.emptyJobs %} {% code @@ -189,13 +189,13 @@ jobName: jobName, } %} - {%= scrapeJobTargets(num, jts) %} + {%= scrapeJobTargets(num, jts, tsr.hasOriginalLabels) %} {% endfor %}
{% endfunc %} -{% func scrapeJobTargets(num int, jts *jobTargetsStatuses) %} +{% func scrapeJobTargets(num int, jts *jobTargetsStatuses, hasOriginalLabels bool) %}

@@ -209,7 +209,9 @@ Endpoint State Labels - Debug relabeling + {% if hasOriginalLabels %} + Debug relabeling + {% endif %} Scrapes Errors Last Scrape @@ -222,13 +224,20 @@ {% for _, ts := range jts.targetsStatus %} {% code endpoint := ts.sw.Config.ScrapeURL + originalLabels := ts.sw.Config.OriginalLabels + // The target is uniquely identified by a pointer to its original labels. - targetID := getLabelsID(ts.sw.Config.OriginalLabels) + targetID := getLabelsID(originalLabels) lastScrapeDuration := ts.getDurationFromLastScrape() %} - {%= endpointContent(endpoint, targetID)%} + {%s endpoint %} + {% if hasOriginalLabels %} + {% space %} + (response) + {% endif %} {% if ts.up %} @@ -238,11 +247,26 @@ {% endif %} - {%= labelsContent(targetID, ts.sw.Config) %} - - - {%= debugRelabelingContent(targetID)%} +
+ {%= formatLabels(ts.sw.Config.Labels) %} +
+ {% if hasOriginalLabels %} + + {% endif %} + {% if hasOriginalLabels %} + + target{% space %} + metrics + + {% endif %} {%d ts.scrapesTotal %} {%d ts.scrapesFailed %} @@ -264,6 +288,11 @@ {% endfunc %} {% func discoveredTargets(tsr *targetsStatusResult) %} + {% if !tsr.hasOriginalLabels %} + Discovered targets are unavailable when -promscrape.dropOriginalLabels command-line flag is set + {% return %} + {% endif %} + {% code tljs := tsr.getTargetLabelsByJob() %}
@@ -317,7 +346,8 @@ {%= formatLabels(t.labels) %} - {%= discoveredJobsRelabelContent(t.originalLabels) %} + {% code targetID := getLabelsID(t.originalLabels) %} + debug {% endfor %} @@ -370,37 +400,3 @@ {% endfunc %} {% endstripspace %} - -{% func endpointContent(endpoint, targetID string) %} -{%s endpoint %}{% space %} -{% if targetID != "" %} -(response) -{% endif %} -{% endfunc %} - -{% func labelsContent(targetID string, config *ScrapeWork) %} -
- {%= formatLabels(config.Labels) %} -
-{% if config.OriginalLabels != nil %} - -{% endif %} -{% endfunc %} - -{% func debugRelabelingContent(targetID string) %} -{% if targetID != "" %} -target{% space %} -metrics -{% endif %} -{% endfunc %} - -{% func discoveredJobsRelabelContent(originalLabels *promutils.Labels) %} -{% if originalLabels != nil %} -{% code targetID := getLabelsID(originalLabels) %} -debug -{% endif %} -{% endfunc %} diff --git a/lib/promscrape/targetstatus.qtpl.go b/lib/promscrape/targetstatus.qtpl.go index 43846fa51d..d59f5afb24 100644 --- a/lib/promscrape/targetstatus.qtpl.go +++ b/lib/promscrape/targetstatus.qtpl.go @@ -495,7 +495,7 @@ func streamscrapeTargets(qw422016 *qt422016.Writer, tsr *targetsStatusResult) { //line lib/promscrape/targetstatus.qtpl:182 for i, jts := range tsr.jobTargetsStatuses { //line lib/promscrape/targetstatus.qtpl:183 - streamscrapeJobTargets(qw422016, i, jts) + streamscrapeJobTargets(qw422016, i, jts, tsr.hasOriginalLabels) //line lib/promscrape/targetstatus.qtpl:184 } //line lib/promscrape/targetstatus.qtpl:185 @@ -507,7 +507,7 @@ func streamscrapeTargets(qw422016 *qt422016.Writer, tsr *targetsStatusResult) { } //line lib/promscrape/targetstatus.qtpl:192 - streamscrapeJobTargets(qw422016, num, jts) + streamscrapeJobTargets(qw422016, num, jts, tsr.hasOriginalLabels) //line lib/promscrape/targetstatus.qtpl:193 } //line lib/promscrape/targetstatus.qtpl:193 @@ -542,7 +542,7 @@ func scrapeTargets(tsr *targetsStatusResult) string { } //line lib/promscrape/targetstatus.qtpl:198 -func streamscrapeJobTargets(qw422016 *qt422016.Writer, num int, jts *jobTargetsStatuses) { +func streamscrapeJobTargets(qw422016 *qt422016.Writer, num int, jts *jobTargetsStatuses, hasOriginalLabels bool) { //line lib/promscrape/targetstatus.qtpl:198 qw422016.N().S(`

`) //line lib/promscrape/targetstatus.qtpl:202 @@ -568,325 +568,412 @@ func streamscrapeJobTargets(qw422016 *qt422016.Writer, num int, jts *jobTargetsS //line lib/promscrape/targetstatus.qtpl:205 qw422016.N().D(num) //line lib/promscrape/targetstatus.qtpl:205 - qw422016.N().S(`" class="scrape-job table-responsive">`) -//line lib/promscrape/targetstatus.qtpl:222 - for _, ts := range jts.targetsStatus { + qw422016.N().S(`" class="scrape-job table-responsive">
EndpointStateLabelsDebug relabelingScrapesErrorsLast ScrapeDurationSamplesLast error
`) +//line lib/promscrape/targetstatus.qtpl:212 + if hasOriginalLabels { +//line lib/promscrape/targetstatus.qtpl:212 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:214 + } +//line lib/promscrape/targetstatus.qtpl:214 + qw422016.N().S(``) //line lib/promscrape/targetstatus.qtpl:224 + for _, ts := range jts.targetsStatus { +//line lib/promscrape/targetstatus.qtpl:226 endpoint := ts.sw.Config.ScrapeURL + originalLabels := ts.sw.Config.OriginalLabels + // The target is uniquely identified by a pointer to its original labels. - targetID := getLabelsID(ts.sw.Config.OriginalLabels) + targetID := getLabelsID(originalLabels) lastScrapeDuration := ts.getDurationFromLastScrape() -//line lib/promscrape/targetstatus.qtpl:228 +//line lib/promscrape/targetstatus.qtpl:232 qw422016.N().S(``) + streamformatLabels(qw422016, ts.sw.Config.Labels) +//line lib/promscrape/targetstatus.qtpl:256 + qw422016.N().S(``) //line lib/promscrape/targetstatus.qtpl:258 - } + if hasOriginalLabels { //line lib/promscrape/targetstatus.qtpl:258 - qw422016.N().S(`
EndpointStateLabelsDebug relabelingScrapesErrorsLast ScrapeDurationSamplesLast error
`) -//line lib/promscrape/targetstatus.qtpl:231 - streamendpointContent(qw422016, endpoint, targetID) -//line lib/promscrape/targetstatus.qtpl:231 +//line lib/promscrape/targetstatus.qtpl:233 + qw422016.N().S(`>`) +//line lib/promscrape/targetstatus.qtpl:235 + qw422016.E().S(endpoint) +//line lib/promscrape/targetstatus.qtpl:235 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:236 + if hasOriginalLabels { +//line lib/promscrape/targetstatus.qtpl:237 + qw422016.N().S(` `) +//line lib/promscrape/targetstatus.qtpl:237 + qw422016.N().S(`(response)`) +//line lib/promscrape/targetstatus.qtpl:240 + } +//line lib/promscrape/targetstatus.qtpl:240 qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:234 +//line lib/promscrape/targetstatus.qtpl:243 if ts.up { -//line lib/promscrape/targetstatus.qtpl:234 +//line lib/promscrape/targetstatus.qtpl:243 qw422016.N().S(`UP`) -//line lib/promscrape/targetstatus.qtpl:236 +//line lib/promscrape/targetstatus.qtpl:245 } else { -//line lib/promscrape/targetstatus.qtpl:236 +//line lib/promscrape/targetstatus.qtpl:245 qw422016.N().S(`DOWN`) -//line lib/promscrape/targetstatus.qtpl:238 - } -//line lib/promscrape/targetstatus.qtpl:238 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:241 - streamlabelsContent(qw422016, targetID, ts.sw.Config) -//line lib/promscrape/targetstatus.qtpl:241 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:244 - streamdebugRelabelingContent(qw422016, targetID) -//line lib/promscrape/targetstatus.qtpl:244 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:246 - qw422016.N().D(ts.scrapesTotal) -//line lib/promscrape/targetstatus.qtpl:246 - qw422016.N().S(``) //line lib/promscrape/targetstatus.qtpl:247 - qw422016.N().D(ts.scrapesFailed) + } //line lib/promscrape/targetstatus.qtpl:247 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:249 - if lastScrapeDuration < 365*24*time.Hour { -//line lib/promscrape/targetstatus.qtpl:250 - qw422016.N().D(int(lastScrapeDuration.Milliseconds())) -//line lib/promscrape/targetstatus.qtpl:250 - qw422016.N().S(`ms ago`) + qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:255 - qw422016.N().D(ts.samplesScraped) -//line lib/promscrape/targetstatus.qtpl:255 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:256 - if ts.err != nil { -//line lib/promscrape/targetstatus.qtpl:256 - qw422016.E().S(ts.err.Error()) -//line lib/promscrape/targetstatus.qtpl:256 } +//line lib/promscrape/targetstatus.qtpl:254 + qw422016.N().S(`>`) //line lib/promscrape/targetstatus.qtpl:256 - qw422016.N().S(`

`) + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:262 + } +//line lib/promscrape/targetstatus.qtpl:262 + qw422016.N().S(``) //line lib/promscrape/targetstatus.qtpl:264 -} - + if hasOriginalLabels { //line lib/promscrape/targetstatus.qtpl:264 -func writescrapeJobTargets(qq422016 qtio422016.Writer, num int, jts *jobTargetsStatuses) { -//line lib/promscrape/targetstatus.qtpl:264 - qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:264 - streamscrapeJobTargets(qw422016, num, jts) -//line lib/promscrape/targetstatus.qtpl:264 - qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:264 -} - -//line lib/promscrape/targetstatus.qtpl:264 -func scrapeJobTargets(num int, jts *jobTargetsStatuses) string { -//line lib/promscrape/targetstatus.qtpl:264 - qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:264 - writescrapeJobTargets(qb422016, num, jts) -//line lib/promscrape/targetstatus.qtpl:264 - qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:264 - qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:264 - return qs422016 -//line lib/promscrape/targetstatus.qtpl:264 -} - + qw422016.N().S(`target`) +//line lib/promscrape/targetstatus.qtpl:266 + qw422016.N().S(` `) +//line lib/promscrape/targetstatus.qtpl:266 + qw422016.N().S(`metrics`) +//line lib/promscrape/targetstatus.qtpl:269 + } +//line lib/promscrape/targetstatus.qtpl:269 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:270 + qw422016.N().D(ts.scrapesTotal) +//line lib/promscrape/targetstatus.qtpl:270 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:271 + qw422016.N().D(ts.scrapesFailed) +//line lib/promscrape/targetstatus.qtpl:271 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:273 + if lastScrapeDuration < 365*24*time.Hour { +//line lib/promscrape/targetstatus.qtpl:274 + qw422016.N().D(int(lastScrapeDuration.Milliseconds())) +//line lib/promscrape/targetstatus.qtpl:274 + qw422016.N().S(`ms ago`) +//line lib/promscrape/targetstatus.qtpl:275 + } else { +//line lib/promscrape/targetstatus.qtpl:275 + qw422016.N().S(`none`) +//line lib/promscrape/targetstatus.qtpl:277 + } +//line lib/promscrape/targetstatus.qtpl:277 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:278 + qw422016.N().D(int(ts.scrapeDuration)) +//line lib/promscrape/targetstatus.qtpl:278 + qw422016.N().S(`ms`) +//line lib/promscrape/targetstatus.qtpl:279 + qw422016.N().D(ts.samplesScraped) +//line lib/promscrape/targetstatus.qtpl:279 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:280 + if ts.err != nil { +//line lib/promscrape/targetstatus.qtpl:280 + qw422016.E().S(ts.err.Error()) +//line lib/promscrape/targetstatus.qtpl:280 + } +//line lib/promscrape/targetstatus.qtpl:280 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:282 + } +//line lib/promscrape/targetstatus.qtpl:282 + qw422016.N().S(`

`) +//line lib/promscrape/targetstatus.qtpl:288 +} + +//line lib/promscrape/targetstatus.qtpl:288 +func writescrapeJobTargets(qq422016 qtio422016.Writer, num int, jts *jobTargetsStatuses, hasOriginalLabels bool) { +//line lib/promscrape/targetstatus.qtpl:288 + qw422016 := qt422016.AcquireWriter(qq422016) +//line lib/promscrape/targetstatus.qtpl:288 + streamscrapeJobTargets(qw422016, num, jts, hasOriginalLabels) +//line lib/promscrape/targetstatus.qtpl:288 + qt422016.ReleaseWriter(qw422016) +//line lib/promscrape/targetstatus.qtpl:288 +} + +//line lib/promscrape/targetstatus.qtpl:288 +func scrapeJobTargets(num int, jts *jobTargetsStatuses, hasOriginalLabels bool) string { +//line lib/promscrape/targetstatus.qtpl:288 + qb422016 := qt422016.AcquireByteBuffer() +//line lib/promscrape/targetstatus.qtpl:288 + writescrapeJobTargets(qb422016, num, jts, hasOriginalLabels) +//line lib/promscrape/targetstatus.qtpl:288 + qs422016 := string(qb422016.B) +//line lib/promscrape/targetstatus.qtpl:288 + qt422016.ReleaseByteBuffer(qb422016) +//line lib/promscrape/targetstatus.qtpl:288 + return qs422016 +//line lib/promscrape/targetstatus.qtpl:288 +} + +//line lib/promscrape/targetstatus.qtpl:290 +func streamdiscoveredTargets(qw422016 *qt422016.Writer, tsr *targetsStatusResult) { +//line lib/promscrape/targetstatus.qtpl:291 + if !tsr.hasOriginalLabels { +//line lib/promscrape/targetstatus.qtpl:291 + qw422016.N().S(`Discovered targets are unavailable when -promscrape.dropOriginalLabels command-line flag is set`) +//line lib/promscrape/targetstatus.qtpl:293 + return +//line lib/promscrape/targetstatus.qtpl:294 + } +//line lib/promscrape/targetstatus.qtpl:296 tljs := tsr.getTargetLabelsByJob() -//line lib/promscrape/targetstatus.qtpl:267 +//line lib/promscrape/targetstatus.qtpl:296 qw422016.N().S(`
`) -//line lib/promscrape/targetstatus.qtpl:270 +//line lib/promscrape/targetstatus.qtpl:299 for i, tlj := range tljs { -//line lib/promscrape/targetstatus.qtpl:271 +//line lib/promscrape/targetstatus.qtpl:300 streamdiscoveredJobTargets(qw422016, i, tlj) -//line lib/promscrape/targetstatus.qtpl:272 - } -//line lib/promscrape/targetstatus.qtpl:272 - qw422016.N().S(`
`) -//line lib/promscrape/targetstatus.qtpl:275 -} - -//line lib/promscrape/targetstatus.qtpl:275 -func writediscoveredTargets(qq422016 qtio422016.Writer, tsr *targetsStatusResult) { -//line lib/promscrape/targetstatus.qtpl:275 - qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:275 - streamdiscoveredTargets(qw422016, tsr) -//line lib/promscrape/targetstatus.qtpl:275 - qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:275 -} - -//line lib/promscrape/targetstatus.qtpl:275 -func discoveredTargets(tsr *targetsStatusResult) string { -//line lib/promscrape/targetstatus.qtpl:275 - qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:275 - writediscoveredTargets(qb422016, tsr) -//line lib/promscrape/targetstatus.qtpl:275 - qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:275 - qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:275 - return qs422016 -//line lib/promscrape/targetstatus.qtpl:275 -} - -//line lib/promscrape/targetstatus.qtpl:277 -func streamdiscoveredJobTargets(qw422016 *qt422016.Writer, num int, tlj *targetLabelsByJob) { -//line lib/promscrape/targetstatus.qtpl:277 - qw422016.N().S(`

`) -//line lib/promscrape/targetstatus.qtpl:279 - qw422016.E().S(tlj.jobName) -//line lib/promscrape/targetstatus.qtpl:279 - qw422016.N().S(` `) -//line lib/promscrape/targetstatus.qtpl:279 - qw422016.N().S(`(`) -//line lib/promscrape/targetstatus.qtpl:279 - qw422016.N().D(tlj.activeTargets) -//line lib/promscrape/targetstatus.qtpl:279 - qw422016.N().S(`/`) -//line lib/promscrape/targetstatus.qtpl:279 - qw422016.N().D(tlj.activeTargets + tlj.droppedTargets) -//line lib/promscrape/targetstatus.qtpl:279 - qw422016.N().S(` `) -//line lib/promscrape/targetstatus.qtpl:279 - qw422016.N().S(`active)`) -//line lib/promscrape/targetstatus.qtpl:280 - streamshowHideScrapeJobButtons(qw422016, num) -//line lib/promscrape/targetstatus.qtpl:280 - qw422016.N().S(`

`) -//line lib/promscrape/targetstatus.qtpl:293 - for _, t := range tlj.targets { -//line lib/promscrape/targetstatus.qtpl:293 - qw422016.N().S(` 0 { -//line lib/promscrape/targetstatus.qtpl:297 - qw422016.N().S(`class="alert alert-danger"`) -//line lib/promscrape/targetstatus.qtpl:299 - } else { -//line lib/promscrape/targetstatus.qtpl:299 - qw422016.N().S(`class="alert alert-warning"`) //line lib/promscrape/targetstatus.qtpl:301 - } -//line lib/promscrape/targetstatus.qtpl:302 - } -//line lib/promscrape/targetstatus.qtpl:302 - qw422016.N().S(`>`) -//line lib/promscrape/targetstatus.qtpl:323 } -//line lib/promscrape/targetstatus.qtpl:323 - qw422016.N().S(`
StatusDiscovered LabelsTarget LabelsDebug relabeling
`) -//line lib/promscrape/targetstatus.qtpl:305 - if t.up { -//line lib/promscrape/targetstatus.qtpl:305 - qw422016.N().S(`UP`) -//line lib/promscrape/targetstatus.qtpl:307 - } else if t.labels.Len() > 0 { -//line lib/promscrape/targetstatus.qtpl:307 - qw422016.N().S(`DOWN`) -//line lib/promscrape/targetstatus.qtpl:309 - } else { -//line lib/promscrape/targetstatus.qtpl:309 - qw422016.N().S(`DROPPED`) -//line lib/promscrape/targetstatus.qtpl:311 - } -//line lib/promscrape/targetstatus.qtpl:311 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:314 - streamformatLabels(qw422016, t.originalLabels) -//line lib/promscrape/targetstatus.qtpl:314 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:317 - streamformatLabels(qw422016, t.labels) -//line lib/promscrape/targetstatus.qtpl:317 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:320 - streamdiscoveredJobsRelabelContent(qw422016, t.originalLabels) -//line lib/promscrape/targetstatus.qtpl:320 - qw422016.N().S(`
`) -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:301 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:304 } -//line lib/promscrape/targetstatus.qtpl:327 -func writediscoveredJobTargets(qq422016 qtio422016.Writer, num int, tlj *targetLabelsByJob) { -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:304 +func writediscoveredTargets(qq422016 qtio422016.Writer, tsr *targetsStatusResult) { +//line lib/promscrape/targetstatus.qtpl:304 qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:327 - streamdiscoveredJobTargets(qw422016, num, tlj) -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:304 + streamdiscoveredTargets(qw422016, tsr) +//line lib/promscrape/targetstatus.qtpl:304 qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:304 } -//line lib/promscrape/targetstatus.qtpl:327 -func discoveredJobTargets(num int, tlj *targetLabelsByJob) string { -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:304 +func discoveredTargets(tsr *targetsStatusResult) string { +//line lib/promscrape/targetstatus.qtpl:304 qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:327 - writediscoveredJobTargets(qb422016, num, tlj) -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:304 + writediscoveredTargets(qb422016, tsr) +//line lib/promscrape/targetstatus.qtpl:304 qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:304 qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:304 return qs422016 -//line lib/promscrape/targetstatus.qtpl:327 +//line lib/promscrape/targetstatus.qtpl:304 } -//line lib/promscrape/targetstatus.qtpl:329 -func streamshowHideScrapeJobButtons(qw422016 *qt422016.Writer, num int) { -//line lib/promscrape/targetstatus.qtpl:329 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:338 -} - -//line lib/promscrape/targetstatus.qtpl:338 -func writeshowHideScrapeJobButtons(qq422016 qtio422016.Writer, num int) { -//line lib/promscrape/targetstatus.qtpl:338 - qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:338 +//line lib/promscrape/targetstatus.qtpl:306 +func streamdiscoveredJobTargets(qw422016 *qt422016.Writer, num int, tlj *targetLabelsByJob) { +//line lib/promscrape/targetstatus.qtpl:306 + qw422016.N().S(`

`) +//line lib/promscrape/targetstatus.qtpl:308 + qw422016.E().S(tlj.jobName) +//line lib/promscrape/targetstatus.qtpl:308 + qw422016.N().S(` `) +//line lib/promscrape/targetstatus.qtpl:308 + qw422016.N().S(`(`) +//line lib/promscrape/targetstatus.qtpl:308 + qw422016.N().D(tlj.activeTargets) +//line lib/promscrape/targetstatus.qtpl:308 + qw422016.N().S(`/`) +//line lib/promscrape/targetstatus.qtpl:308 + qw422016.N().D(tlj.activeTargets + tlj.droppedTargets) +//line lib/promscrape/targetstatus.qtpl:308 + qw422016.N().S(` `) +//line lib/promscrape/targetstatus.qtpl:308 + qw422016.N().S(`active)`) +//line lib/promscrape/targetstatus.qtpl:309 streamshowHideScrapeJobButtons(qw422016, num) +//line lib/promscrape/targetstatus.qtpl:309 + qw422016.N().S(`

`) +//line lib/promscrape/targetstatus.qtpl:322 + for _, t := range tlj.targets { +//line lib/promscrape/targetstatus.qtpl:322 + qw422016.N().S(` 0 { +//line lib/promscrape/targetstatus.qtpl:326 + qw422016.N().S(`class="alert alert-danger"`) +//line lib/promscrape/targetstatus.qtpl:328 + } else { +//line lib/promscrape/targetstatus.qtpl:328 + qw422016.N().S(`class="alert alert-warning"`) +//line lib/promscrape/targetstatus.qtpl:330 + } +//line lib/promscrape/targetstatus.qtpl:331 + } +//line lib/promscrape/targetstatus.qtpl:331 + qw422016.N().S(`>`) +//line lib/promscrape/targetstatus.qtpl:353 + } +//line lib/promscrape/targetstatus.qtpl:353 + qw422016.N().S(`
StatusDiscovered LabelsTarget LabelsDebug relabeling
`) +//line lib/promscrape/targetstatus.qtpl:334 + if t.up { +//line lib/promscrape/targetstatus.qtpl:334 + qw422016.N().S(`UP`) +//line lib/promscrape/targetstatus.qtpl:336 + } else if t.labels.Len() > 0 { +//line lib/promscrape/targetstatus.qtpl:336 + qw422016.N().S(`DOWN`) //line lib/promscrape/targetstatus.qtpl:338 - qt422016.ReleaseWriter(qw422016) + } else { //line lib/promscrape/targetstatus.qtpl:338 -} - -//line lib/promscrape/targetstatus.qtpl:338 -func showHideScrapeJobButtons(num int) string { -//line lib/promscrape/targetstatus.qtpl:338 - qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:338 - writeshowHideScrapeJobButtons(qb422016, num) -//line lib/promscrape/targetstatus.qtpl:338 - qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:338 - qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:338 - return qs422016 -//line lib/promscrape/targetstatus.qtpl:338 -} - + qw422016.N().S(`DROPPED`) //line lib/promscrape/targetstatus.qtpl:340 + } +//line lib/promscrape/targetstatus.qtpl:340 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:343 + streamformatLabels(qw422016, t.originalLabels) +//line lib/promscrape/targetstatus.qtpl:343 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:346 + streamformatLabels(qw422016, t.labels) +//line lib/promscrape/targetstatus.qtpl:346 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:349 + targetID := getLabelsID(t.originalLabels) + +//line lib/promscrape/targetstatus.qtpl:349 + qw422016.N().S(`debug
`) +//line lib/promscrape/targetstatus.qtpl:357 +} + +//line lib/promscrape/targetstatus.qtpl:357 +func writediscoveredJobTargets(qq422016 qtio422016.Writer, num int, tlj *targetLabelsByJob) { +//line lib/promscrape/targetstatus.qtpl:357 + qw422016 := qt422016.AcquireWriter(qq422016) +//line lib/promscrape/targetstatus.qtpl:357 + streamdiscoveredJobTargets(qw422016, num, tlj) +//line lib/promscrape/targetstatus.qtpl:357 + qt422016.ReleaseWriter(qw422016) +//line lib/promscrape/targetstatus.qtpl:357 +} + +//line lib/promscrape/targetstatus.qtpl:357 +func discoveredJobTargets(num int, tlj *targetLabelsByJob) string { +//line lib/promscrape/targetstatus.qtpl:357 + qb422016 := qt422016.AcquireByteBuffer() +//line lib/promscrape/targetstatus.qtpl:357 + writediscoveredJobTargets(qb422016, num, tlj) +//line lib/promscrape/targetstatus.qtpl:357 + qs422016 := string(qb422016.B) +//line lib/promscrape/targetstatus.qtpl:357 + qt422016.ReleaseByteBuffer(qb422016) +//line lib/promscrape/targetstatus.qtpl:357 + return qs422016 +//line lib/promscrape/targetstatus.qtpl:357 +} + +//line lib/promscrape/targetstatus.qtpl:359 +func streamshowHideScrapeJobButtons(qw422016 *qt422016.Writer, num int) { +//line lib/promscrape/targetstatus.qtpl:359 + qw422016.N().S(``) +//line lib/promscrape/targetstatus.qtpl:368 +} + +//line lib/promscrape/targetstatus.qtpl:368 +func writeshowHideScrapeJobButtons(qq422016 qtio422016.Writer, num int) { +//line lib/promscrape/targetstatus.qtpl:368 + qw422016 := qt422016.AcquireWriter(qq422016) +//line lib/promscrape/targetstatus.qtpl:368 + streamshowHideScrapeJobButtons(qw422016, num) +//line lib/promscrape/targetstatus.qtpl:368 + qt422016.ReleaseWriter(qw422016) +//line lib/promscrape/targetstatus.qtpl:368 +} + +//line lib/promscrape/targetstatus.qtpl:368 +func showHideScrapeJobButtons(num int) string { +//line lib/promscrape/targetstatus.qtpl:368 + qb422016 := qt422016.AcquireByteBuffer() +//line lib/promscrape/targetstatus.qtpl:368 + writeshowHideScrapeJobButtons(qb422016, num) +//line lib/promscrape/targetstatus.qtpl:368 + qs422016 := string(qb422016.B) +//line lib/promscrape/targetstatus.qtpl:368 + qt422016.ReleaseByteBuffer(qb422016) +//line lib/promscrape/targetstatus.qtpl:368 + return qs422016 +//line lib/promscrape/targetstatus.qtpl:368 +} + +//line lib/promscrape/targetstatus.qtpl:370 func streamqueryArgs(qw422016 *qt422016.Writer, filter *requestFilter, override map[string]string) { -//line lib/promscrape/targetstatus.qtpl:342 +//line lib/promscrape/targetstatus.qtpl:372 showOnlyUnhealthy := "false" if filter.showOnlyUnhealthy { showOnlyUnhealthy = "true" @@ -904,340 +991,89 @@ func streamqueryArgs(qw422016 *qt422016.Writer, filter *requestFilter, override qa[k] = []string{v} } -//line lib/promscrape/targetstatus.qtpl:359 +//line lib/promscrape/targetstatus.qtpl:389 qw422016.E().S(qa.Encode()) -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 } -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 func writequeryArgs(qq422016 qtio422016.Writer, filter *requestFilter, override map[string]string) { -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 streamqueryArgs(qw422016, filter, override) -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 } -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 func queryArgs(filter *requestFilter, override map[string]string) string { -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 writequeryArgs(qb422016, filter, override) -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 return qs422016 -//line lib/promscrape/targetstatus.qtpl:360 +//line lib/promscrape/targetstatus.qtpl:390 } -//line lib/promscrape/targetstatus.qtpl:362 +//line lib/promscrape/targetstatus.qtpl:392 func streamformatLabels(qw422016 *qt422016.Writer, labels *promutils.Labels) { -//line lib/promscrape/targetstatus.qtpl:363 +//line lib/promscrape/targetstatus.qtpl:393 labelsList := labels.GetLabels() -//line lib/promscrape/targetstatus.qtpl:363 +//line lib/promscrape/targetstatus.qtpl:393 qw422016.N().S(`{`) -//line lib/promscrape/targetstatus.qtpl:365 +//line lib/promscrape/targetstatus.qtpl:395 for i, label := range labelsList { -//line lib/promscrape/targetstatus.qtpl:366 +//line lib/promscrape/targetstatus.qtpl:396 qw422016.E().S(label.Name) -//line lib/promscrape/targetstatus.qtpl:366 +//line lib/promscrape/targetstatus.qtpl:396 qw422016.N().S(`=`) -//line lib/promscrape/targetstatus.qtpl:366 +//line lib/promscrape/targetstatus.qtpl:396 qw422016.E().Q(label.Value) -//line lib/promscrape/targetstatus.qtpl:367 +//line lib/promscrape/targetstatus.qtpl:397 if i+1 < len(labelsList) { -//line lib/promscrape/targetstatus.qtpl:367 +//line lib/promscrape/targetstatus.qtpl:397 qw422016.N().S(`,`) -//line lib/promscrape/targetstatus.qtpl:367 +//line lib/promscrape/targetstatus.qtpl:397 qw422016.N().S(` `) -//line lib/promscrape/targetstatus.qtpl:367 +//line lib/promscrape/targetstatus.qtpl:397 } -//line lib/promscrape/targetstatus.qtpl:368 +//line lib/promscrape/targetstatus.qtpl:398 } -//line lib/promscrape/targetstatus.qtpl:368 +//line lib/promscrape/targetstatus.qtpl:398 qw422016.N().S(`}`) -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 } -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 func writeformatLabels(qq422016 qtio422016.Writer, labels *promutils.Labels) { -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 streamformatLabels(qw422016, labels) -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 } -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 func formatLabels(labels *promutils.Labels) string { -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 writeformatLabels(qb422016, labels) -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:370 +//line lib/promscrape/targetstatus.qtpl:400 return qs422016 -//line lib/promscrape/targetstatus.qtpl:370 -} - -//line lib/promscrape/targetstatus.qtpl:374 -func streamendpointContent(qw422016 *qt422016.Writer, endpoint, targetID string) { -//line lib/promscrape/targetstatus.qtpl:374 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:375 - qw422016.E().S(endpoint) -//line lib/promscrape/targetstatus.qtpl:375 - qw422016.N().S(``) -//line lib/promscrape/targetstatus.qtpl:375 - qw422016.N().S(` `) -//line lib/promscrape/targetstatus.qtpl:375 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:376 - if targetID != "" { -//line lib/promscrape/targetstatus.qtpl:376 - qw422016.N().S(` -(response) -`) -//line lib/promscrape/targetstatus.qtpl:379 - } -//line lib/promscrape/targetstatus.qtpl:379 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:380 -} - -//line lib/promscrape/targetstatus.qtpl:380 -func writeendpointContent(qq422016 qtio422016.Writer, endpoint, targetID string) { -//line lib/promscrape/targetstatus.qtpl:380 - qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:380 - streamendpointContent(qw422016, endpoint, targetID) -//line lib/promscrape/targetstatus.qtpl:380 - qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:380 -} - -//line lib/promscrape/targetstatus.qtpl:380 -func endpointContent(endpoint, targetID string) string { -//line lib/promscrape/targetstatus.qtpl:380 - qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:380 - writeendpointContent(qb422016, endpoint, targetID) -//line lib/promscrape/targetstatus.qtpl:380 - qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:380 - qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:380 - return qs422016 -//line lib/promscrape/targetstatus.qtpl:380 -} - -//line lib/promscrape/targetstatus.qtpl:382 -func streamlabelsContent(qw422016 *qt422016.Writer, targetID string, config *ScrapeWork) { -//line lib/promscrape/targetstatus.qtpl:382 - qw422016.N().S(` -
- `) -//line lib/promscrape/targetstatus.qtpl:385 - streamformatLabels(qw422016, config.Labels) -//line lib/promscrape/targetstatus.qtpl:385 - qw422016.N().S(` -
-`) -//line lib/promscrape/targetstatus.qtpl:387 - if config.OriginalLabels != nil { -//line lib/promscrape/targetstatus.qtpl:387 - qw422016.N().S(` - -`) -//line lib/promscrape/targetstatus.qtpl:391 - } -//line lib/promscrape/targetstatus.qtpl:391 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:392 -} - -//line lib/promscrape/targetstatus.qtpl:392 -func writelabelsContent(qq422016 qtio422016.Writer, targetID string, config *ScrapeWork) { -//line lib/promscrape/targetstatus.qtpl:392 - qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:392 - streamlabelsContent(qw422016, targetID, config) -//line lib/promscrape/targetstatus.qtpl:392 - qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:392 -} - -//line lib/promscrape/targetstatus.qtpl:392 -func labelsContent(targetID string, config *ScrapeWork) string { -//line lib/promscrape/targetstatus.qtpl:392 - qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:392 - writelabelsContent(qb422016, targetID, config) -//line lib/promscrape/targetstatus.qtpl:392 - qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:392 - qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:392 - return qs422016 -//line lib/promscrape/targetstatus.qtpl:392 -} - -//line lib/promscrape/targetstatus.qtpl:394 -func streamdebugRelabelingContent(qw422016 *qt422016.Writer, targetID string) { -//line lib/promscrape/targetstatus.qtpl:394 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:395 - if targetID != "" { -//line lib/promscrape/targetstatus.qtpl:395 - qw422016.N().S(` -target`) -//line lib/promscrape/targetstatus.qtpl:396 - qw422016.N().S(` `) -//line lib/promscrape/targetstatus.qtpl:396 - qw422016.N().S(` -metrics -`) -//line lib/promscrape/targetstatus.qtpl:398 - } -//line lib/promscrape/targetstatus.qtpl:398 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:399 -} - -//line lib/promscrape/targetstatus.qtpl:399 -func writedebugRelabelingContent(qq422016 qtio422016.Writer, targetID string) { -//line lib/promscrape/targetstatus.qtpl:399 - qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:399 - streamdebugRelabelingContent(qw422016, targetID) -//line lib/promscrape/targetstatus.qtpl:399 - qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:399 -} - -//line lib/promscrape/targetstatus.qtpl:399 -func debugRelabelingContent(targetID string) string { -//line lib/promscrape/targetstatus.qtpl:399 - qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:399 - writedebugRelabelingContent(qb422016, targetID) -//line lib/promscrape/targetstatus.qtpl:399 - qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:399 - qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:399 - return qs422016 -//line lib/promscrape/targetstatus.qtpl:399 -} - -//line lib/promscrape/targetstatus.qtpl:401 -func streamdiscoveredJobsRelabelContent(qw422016 *qt422016.Writer, originalLabels *promutils.Labels) { -//line lib/promscrape/targetstatus.qtpl:401 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:402 - if originalLabels != nil { -//line lib/promscrape/targetstatus.qtpl:402 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:403 - targetID := getLabelsID(originalLabels) - -//line lib/promscrape/targetstatus.qtpl:403 - qw422016.N().S(` -debug -`) -//line lib/promscrape/targetstatus.qtpl:405 - } -//line lib/promscrape/targetstatus.qtpl:405 - qw422016.N().S(` -`) -//line lib/promscrape/targetstatus.qtpl:406 -} - -//line lib/promscrape/targetstatus.qtpl:406 -func writediscoveredJobsRelabelContent(qq422016 qtio422016.Writer, originalLabels *promutils.Labels) { -//line lib/promscrape/targetstatus.qtpl:406 - qw422016 := qt422016.AcquireWriter(qq422016) -//line lib/promscrape/targetstatus.qtpl:406 - streamdiscoveredJobsRelabelContent(qw422016, originalLabels) -//line lib/promscrape/targetstatus.qtpl:406 - qt422016.ReleaseWriter(qw422016) -//line lib/promscrape/targetstatus.qtpl:406 -} - -//line lib/promscrape/targetstatus.qtpl:406 -func discoveredJobsRelabelContent(originalLabels *promutils.Labels) string { -//line lib/promscrape/targetstatus.qtpl:406 - qb422016 := qt422016.AcquireByteBuffer() -//line lib/promscrape/targetstatus.qtpl:406 - writediscoveredJobsRelabelContent(qb422016, originalLabels) -//line lib/promscrape/targetstatus.qtpl:406 - qs422016 := string(qb422016.B) -//line lib/promscrape/targetstatus.qtpl:406 - qt422016.ReleaseByteBuffer(qb422016) -//line lib/promscrape/targetstatus.qtpl:406 - return qs422016 -//line lib/promscrape/targetstatus.qtpl:406 +//line lib/promscrape/targetstatus.qtpl:400 }