Prometheus: Create feature flag to disable exemplar sampling (#60105)

:Fix rebase
This commit is contained in:
Ludovic Viaud
2022-12-19 16:00:15 +01:00
committed by GitHub
parent bce33eeb85
commit f67b8fe0dc
7 changed files with 64 additions and 38 deletions
+3 -3
View File
@@ -41,7 +41,7 @@ func (s *QueryData) parseResponse(ctx context.Context, q *models.Query, res *htt
}
}
r = processExemplars(q, r)
r = processExemplars(q, r, s.disablePrometheusExemplarSampling)
return r, nil
}
@@ -136,8 +136,8 @@ func getName(q *models.Query, field *data.Field) string {
return legend
}
func processExemplars(q *models.Query, dr *backend.DataResponse) *backend.DataResponse {
sampler := newExemplarSampler()
func processExemplars(q *models.Query, dr *backend.DataResponse, disableSampling bool) *backend.DataResponse {
sampler := newExemplarSampler(disableSampling)
// we are moving from a multi-frame response returned
// by the converter to a single exemplar frame,