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)
| 156 | // The fallback logic is to provide consistent results during rollout of the instant flag |
| 157 | // and will be removed in a future release. |
| 158 | func 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". |
no test coverage detected