-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vmalert: plotting a recorded metric along with the original in grafana requires a offset for them to match #1232
Comments
Hi @raags! I think I understand now why would that happen. I think, I'll come up with something this week. Thank you for detailed report! |
Hi @raags! Pls see #1257 PR which may help in this case. Please see how to build vmalert from sources here https://docs.victoriametrics.com/vmalert.html#how-to-build-from-sources |
@hagen1778 Thanks, I'll check against the PR. The values for |
Correct. Updated my prev comment.
Yes, produced time series will be delayed (missing last data points) but still aligned with original expression. |
Hi @raags! Any updates on this? |
Hi @hagen1778 works as expected, the recorded rule matches exactly with the original query. This has allowed us to replace slow histograms graphs with their corresponding recorded rules, which are much faster now. However, there is one gripe - sometimes the recorded rule has extra data points when compared to the original query. This only happens with histograms, where the orignal metric disappears. Check the below screenshot, where I tried to reproduce it. Its always equal to the last data point, and can span to more than 1 data point. This screenshot is from the prod dashboard: Could this be due to the way histograms are calculated in a recording rule? |
I suspect it could happen due to the following reasons:
Schematically it may be displayed in the following way But this doesn't explain why it happens only to histograms in your case. |
@hagen1778 got it - in that case, can VMagent can somehow be excluded from the staleness behaviour? I see there is a way to set |
It can't be done, unfortunately. The staleness threshold is a global setting and can't be adjusted by clients. This might be a feature request, though (wdyt @valyala ?). |
Closed as inactive |
Describe the bug
The screenshot below shows the difference in the original query and the recording rule. The graph does not match without the
offset
equal to the scrape interval.The following parameters have been explored:
-search.latencyOffset=15s
- (victoriametrics) to ensure recording rule doesn't miss any datapoint (due to delay in scraping)-datasource.queryStep=15s
- (vmagent) - to ensure step matches grafana step-evaluationInterval=15s
- (vmagent) - matches scrape interval-datasource.lookback=15s
- (vmagent) - to let vmagent "offset" match the search latency offset. This should ideally fix the issue I'm seeing.To Reproduce
docker-compose.yml
vm.yml
alert.rules
Plotting
test:scrape_duration_seconds:15s
andsum(rate(scrape_duration_seconds{instance=~"victoriametrics.*"}[15s]))
still requires a15s
offset to match.Expected behavior
The original and recorded metric should match.
Version
The line returned when passing
--version
command line flag to binary. For example:One round of discussion here: #832
The text was updated successfully, but these errors were encountered: