From c339642858d4432e6eabbc1540899efd24b915dc Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 9 Sep 2021 17:37:34 +0300 Subject: [PATCH] lib/promscrape: add the actual job name to the labels of promscrape_series_limit_rows_dropped_total metric --- lib/promscrape/scrapework.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/promscrape/scrapework.go b/lib/promscrape/scrapework.go index 68b342b31..93581b773 100644 --- a/lib/promscrape/scrapework.go +++ b/lib/promscrape/scrapework.go @@ -500,13 +500,14 @@ func (sw *scrapeWork) updateSeriesAdded(wc *writeRequestCtx) { } hsl := sw.seriesLimiter dstSeries := wc.writeRequest.Timeseries[:0] + job := sw.Config.Job() for _, ts := range wc.writeRequest.Timeseries { h := sw.getLabelsHash(ts.Labels) 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{scrape_job=%q,scrape_target=%q}`, - sw.Config.jobNameOriginal, sw.Config.ScrapeURL)).Inc() + metrics.GetOrCreateCounter(fmt.Sprintf(`promscrape_series_limit_rows_dropped_total{scrape_job_original=%q,scrape_job=%q,scrape_target=%q}`, + sw.Config.jobNameOriginal, job, sw.Config.ScrapeURL)).Inc() continue } dstSeries = append(dstSeries, ts)