Skip to content
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

rate behaves differently than in Prometheus #165

Closed
kalgary opened this issue Aug 28, 2019 · 2 comments
Closed

rate behaves differently than in Prometheus #165

kalgary opened this issue Aug 28, 2019 · 2 comments
Labels
question The question issue

Comments

@kalgary
Copy link

kalgary commented Aug 28, 2019

Describe the bug
Hi,
I'm evaluating the use of Victoria metrics as long term storage, my goal is to get rid of Prom federation.

I have noticed a different behavior when the same query is run against prom and victoria metrics.

rate(process_cpu_seconds_total{job="$instance-kafka1"}[1m])

VICTORIA METRICS

image

PROMETHEUS
image

stored time series seems to contain the same data:

process_cpu_seconds_total{job="$instance-kafka1"}

VICTORIA METRICS

image

PROMETHEUS
image

Configuration on Prometheus side:

remote_write:
- url: http://10.8.24.62:8428/api/v1/write
  remote_timeout: 30s
  queue_config:
    capacity: 100000
    max_shards: 30
    max_samples_per_send: 10000
    batch_send_deadline: 5s
    max_retries: 10
    min_backoff: 30ms
    max_backoff: 100ms

Expected behavior
I expect to see the same graph when querying the two different backends from grafana, Prom or Victoria metrics should produce the same trends, but as you can see in the graphs, this is not the case.

Version

$ ./victoria-metrics-prod --version
victoria-metrics-20190813-235905-tags-v1.25.0-0-g5b411222
@valyala
Copy link
Collaborator

valyala commented Aug 28, 2019

VictoriaMetrics takes into account the previous point before the range window in square brackets for implementing all the PromQL functions accepting range vectors, including rate, while Prometheus ignores the previous point before the range window. This resolves the following Prometheus issues:

This may result in slightly different graphs between Prometheus and VictoriaMetrics like on the screenshots. Try increasing range window in square brackets - for example, use [10m] instead of [1m]. This should reduce the discrepancy between Prometheus and VictoriaMetrics graphs.

@valyala valyala added the question The question issue label Aug 28, 2019
@valyala
Copy link
Collaborator

valyala commented Sep 22, 2019

Closing this issue as resolved. Feel free opening new one if significant discrepancies between VictoriaMetrics graphs and Prometheus graphs are detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The question issue
Projects
None yet
Development

No branches or pull requests

2 participants