Prometheus: (Experimental) Inject label matchers into queries (also change drone to fix ARM rpm build and Update Swagger) (#81396)
- Feature Toggle is `promQLScope`.
- Query property is:
"scope": {
"matchers": "{job=~\".*\"}"
}
Misc:
- Also updates drone GO version to address ARM bug https://github.com/golang/go/issues/58425
- Also updates Swagger defs that were causing builds to fail
---------
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
This commit is contained in:
co-authored by
Kevin Minehart
parent
c2b64c6739
commit
43d0664340
@@ -45,6 +45,7 @@ type QueryData struct {
|
||||
URL string
|
||||
TimeInterval string
|
||||
enableDataplane bool
|
||||
enableScope bool
|
||||
exemplarSampler func() exemplar.Sampler
|
||||
}
|
||||
|
||||
@@ -88,6 +89,7 @@ func New(
|
||||
URL: settings.URL,
|
||||
enableDataplane: features.IsEnabledGlobally(featuremgmt.FlagPrometheusDataplane),
|
||||
exemplarSampler: exemplarSampler,
|
||||
enableScope: features.IsEnabledGlobally(featuremgmt.FlagPromQLScope),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -98,7 +100,7 @@ func (s *QueryData) Execute(ctx context.Context, req *backend.QueryDataRequest)
|
||||
}
|
||||
|
||||
for _, q := range req.Queries {
|
||||
query, err := models.Parse(q, s.TimeInterval, s.intervalCalculator, fromAlert)
|
||||
query, err := models.Parse(q, s.TimeInterval, s.intervalCalculator, fromAlert, s.enableScope)
|
||||
if err != nil {
|
||||
return &result, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user