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

How to do the aggregation (hourly, daily) for the gauge metrics in prometheus. #13535

Open
BrivinTech opened this issue Feb 2, 2024 · 1 comment

Comments

@BrivinTech
Copy link

What did you do?

I am storing the gauge metrics (storing the PM data for every 15 mins and those PM data are reset before collecting for next 15 min cycle)

For example, active_users metric will have the value at 10:00 is 50, at 10:15 is 25..

the retention period for these data is 1 year. In one of my use case, I want to render the chart, which should show the date for everey 1 hour or daily. How to do the aggregation query like this in the prometheus.

I am aware that, using api/v1/query API of active_users[30d:1h] will return the data for every 1h for the last 30 days. but here, prometheus doing average of 4 15-min data and mapping to 1h. but for gauge metrics, i want to do the sum of 4 15-min data. Is there any way to do this in the prometheus.? Please help on this.

What did you expect to see?

Nono

What did you see instead? Under which circumstances?

None

System information

No response

Prometheus version

2.14.0

Prometheus configuration file

No response

Alertmanager version

No response

Alertmanager configuration file

No response

Logs

No response

@darshanime
Copy link
Contributor

@BrivinTech, I think the discussions is a better place for questions like these, not the bug tracker. Unless there is something thing you tried that had unexpected output?

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

No branches or pull requests

2 participants