Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upHow can I do sampling on metrics? #1808
Comments
This comment has been minimized.
This comment has been minimized.
|
We don't and won't offer downsampling in Prometheus, however you can call query_range with whatever interval you like. |
This comment has been minimized.
This comment has been minimized.
|
So the recording rule is the only way for my situation? Hope we can have the feature that sets evaluation_interval per rule soon |
This comment has been minimized.
This comment has been minimized.
|
The question here is what are you trying to do? |
This comment has been minimized.
This comment has been minimized.
|
I have a time series with 1.5 million samples collected during the past six months. How can I display them without downsampling? |
This comment has been minimized.
This comment has been minimized.
|
For that you'll need to put |
This comment has been minimized.
This comment has been minimized.
|
Processing the raw data in my application is always doable. However, as prometheus already have a bunch of functions and operators, I hope there would be a way doing such post-processing work in prometheus before returning samples to API callers. For me the recording rule is designed for this, but the global evaluation_interval restricts its usage. |
This comment has been minimized.
This comment has been minimized.
|
BTW, what is the "query endpoint" you mean here? My understanding is the application can only retrieve samples from prometheus thru the HTTP APIs. Does the "query endpoint" here stand for applications? |
This comment has been minimized.
This comment has been minimized.
|
The HTTP API offers several endpoints, |
This comment has been minimized.
This comment has been minimized.
|
It sounds like with you should make multiple query_range calls, or handle the processing inside your application. |
This comment has been minimized.
This comment has been minimized.
|
"It sounds like with you should make multiple query_range calls" we can't do this as the cost is too expensive, my dashboard will access those samples frequently. Now my solution is to create my exporter to create new time series with post-processed samples. The workflow is:
Then my application can just query and render the new series. |
This comment has been minimized.
This comment has been minimized.
|
I think you're greatly over-complicating the problem. Why not just make a normal graph using avg_over_time? |
This comment has been minimized.
This comment has been minimized.
|
avg_over_time returns an instant vector but not a range vector, I don't want to make lots of query_range calls(tens of thousands for 1.5M samples). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The console view uses |
This comment has been minimized.
This comment has been minimized.
|
Awesome! I wasn't aware the query_range has a |
zxwing
closed this
Jul 13, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |


zxwing commentedJul 13, 2016
My application needs to show the monitoring history spanning six months with the scrape_interval = 10s, which says the range vector will have ~1.5M records. We originally plan to use a recording rule to average data with the interval 15m. However, because of the bug #1095 we cannot have other rules averaging data with different intervals(e.g. 30m, 1h).
I'd like to ask your suggestions for this situation. Is there any way we can specify the sampling interval when doing avg()? That says the avg() can return a range vector instead of an instant vector. This feature is available on Kairosdb, below is a screenshot.