-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Arithmetic on the argument of the @ (at) modifier #12318
Comments
There have been thoughts around this for a long time, see this exploratory document, some parts of which are already implemented, some are being worked on, and some are somewhat out in the distance, among them arithmetic on durations and on the argument of the |
Is it possible to currently work on this issue, or is it still somewhat in the distance? If possible I can have a look into it. |
I would say we shouldn't look at arithmetic for the The challenge here is that we need in a way a new concept of "static" arithmetic, i.e. evaluations that do not touch the TSDB. Otherwise, it would be possible to create expressions that require multiple subsequent TSDB lookups (which is something that we might want to support in the future, but not in this first step). So for example, it should be possible to write This might be "not as easy as it looks", but if you would like to give it a spin, it would certainly be very welcome. |
It will touch the parser, for sure, but it might also require quite deep changes in the PromQL engine (which I don't know well enough to tell). |
So to achieve this we need to replace all the
Yeah, it looks complex but I'll try to look into it in my free time. I need to deep dive into the promql engine for this.
Yeah I think it will touch both parser as well as the engine and needs a deep understanding of promql engine I guess. |
I need exactly the same which is mentioned above. In my example I need to get the first of the current month. Then I could create an alert on it to see if we run out out budget on some third party API |
What did you do?
I was trying to retrieve specific metrics at yesterdays midnight (23:59:59) by using something like this:
while
returns an OK timestamp, but while trying to use it like
I'm receiving these kinds of errors
What did you expect to see?
Metric at a specific time.
What did you see instead? Under which circumstances?
Errors:
System information
Prometheus in K8s via Helm (2.43.0)
Prometheus version
Prometheus configuration file
Alertmanager version
Alertmanager configuration file
Logs
The text was updated successfully, but these errors were encountered: