Prometheus: Interpolate vars in adhoc filters request (#94087)
* Interpolate vars in adhoc filters request * interpolate variables on BE --------- Co-authored-by: Kyle Brandt <kyle@grafana.com>
This commit is contained in:
co-authored by
Kyle Brandt
parent
cbf8e7e679
commit
a87df0528b
@@ -207,7 +207,7 @@ func Parse(span trace.Span, query backend.DataQuery, dsScrapeInterval string, in
|
||||
|
||||
// Interpolate variables in expr
|
||||
timeRange := query.TimeRange.To.Sub(query.TimeRange.From)
|
||||
expr := interpolateVariables(
|
||||
expr := InterpolateVariables(
|
||||
model.Expr,
|
||||
query.Interval,
|
||||
calculatedStep,
|
||||
@@ -365,14 +365,14 @@ func calculateRateInterval(
|
||||
return rateInterval
|
||||
}
|
||||
|
||||
// interpolateVariables interpolates built-in variables
|
||||
// InterpolateVariables interpolates built-in variables
|
||||
// expr PromQL query
|
||||
// queryInterval Requested interval in milliseconds. This value may be overridden by MinStep in query options
|
||||
// calculatedStep Calculated final step value. It was calculated in calculatePrometheusInterval
|
||||
// requestedMinStep Requested minimum step value. QueryModel.interval
|
||||
// dsScrapeInterval Data source scrape interval in the config
|
||||
// timeRange Requested time range for query
|
||||
func interpolateVariables(
|
||||
func InterpolateVariables(
|
||||
expr string,
|
||||
queryInterval time.Duration,
|
||||
calculatedStep time.Duration,
|
||||
|
||||
Reference in New Issue
Block a user