lib/promscrape: add scrape_ prefix to job and target labels exported by promscrape_series_limit_rows_dropped_total metric

This is needed in order to prevent from possible clash with the corresponding (job, target) labels for the job, which scrapes this metric.
This commit is contained in:
Aliaksandr Valialkin 2021-09-09 17:29:19 +03:00
parent d2708a1fb7
commit 086b5d0cf1

View file

@ -506,7 +506,7 @@ func (sw *scrapeWork) updateSeriesAdded(wc *writeRequestCtx) {
if hsl != nil && !hsl.Add(h) {
// The limit on the number of hourly unique series per scrape target has been exceeded.
// Drop the metric.
metrics.GetOrCreateCounter(fmt.Sprintf(`promscrape_series_limit_rows_dropped_total{job=%q,target=%q}`,
metrics.GetOrCreateCounter(fmt.Sprintf(`promscrape_series_limit_rows_dropped_total{scrape_job=%q,scrape_target=%q}`,
sw.Config.jobNameOriginal, sw.Config.ScrapeURL)).Inc()
continue
}