Prometheus: Fix calculating rate interval when there is no interval specified #78193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this feature?
When there is no specific interval is picked we send the interval value as an empty string. Data source scrape interval will be used under the hood to calculate the rate interval. We recently updated
$__rate_interval
calculation (see it here: #77234) for an edge case and this case was missed accidentally. This PR is fixing the issue.Why do we need this feature?
Proper
$__rate_interval
calculationWho is this feature for?
All Prometheus users
Special notes for your reviewer:
How to test it?
$__rate_interval
i.esum(rate(process_cpu_seconds_total[$__rate_interval]))
Please check that: