MCPcopy
hub / github.com/grafana/tempo / IsInstant

Function IsInstant

pkg/traceql/engine_metrics.go:158–167  ·  view source on GitHub ↗

IsInstant returns true if the request is an instant query. It relies on the instant flag. If the flag is not provided, it falls back on determining by step and range. The fallback logic is to provide consistent results during rollout of the instant flag and will be removed in a future release.

(req *tempopb.QueryRangeRequest)

Source from the content-addressed store, hash-verified

156// The fallback logic is to provide consistent results during rollout of the instant flag
157// and will be removed in a future release.
158func IsInstant(req *tempopb.QueryRangeRequest) bool {
159 if req == nil {
160 return false
161 }
162 if req.HasInstant() {
163 return req.GetInstant()
164 }
165 // false or no field defined, fallback to old logic.
166 return req.End-req.Start == req.Step
167}
168
169// AlignRequest shifts the start and end times of the request to align with the step
170// interval. This gives more consistent results across refreshes of queries like "last 1 hour".

Callers 11

NewBaselineAggregatorFunction · 0.85
initMethod · 0.85
TrimToBlockOverlapFunction · 0.85
TrimToBeforeFunction · 0.85
TrimToAfterFunction · 0.85
AlignRequestFunction · 0.85
AlignEndToLeftFunction · 0.85
NewSimpleCombinerFunction · 0.85
NewIntervalMapperFromReqFunction · 0.85
NewHistogramAggregatorFunction · 0.85
initMethod · 0.85

Calls 2

HasInstantMethod · 0.80
GetInstantMethod · 0.80

Tested by

no test coverage detected