timestamp now()

22 views
Skip to first unread message

Juan Pablo Roig

unread,
Feb 23, 2024, 2:04:34 PMFeb 23
to Google Stackdriver Discussion Forum
Hello, I am trying to write an alert query that compares the value of a metrics (epoch) with today's timestamp, but I am not able to find in https://cloud.google.com/monitoring/mql/reference how to get the current timestamp, is there a way to do that?

BTW, I asked Gemini to do that for me and the answer do not work in the metrics explorer: https://g.co/gemini/share/7999ba107291

Thanks

Lee Yanco

unread,
Feb 27, 2024, 1:28:44 PMFeb 27
to Juan Pablo Roig, Google Stackdriver Discussion Forum
I'm not sure how to do this with MQL, but this can be done easily with PromQL alerting by using the timestamp() function: https://prometheus.io/docs/prometheus/latest/querying/functions/#timestamp

--
© 2021 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Stackdriver Discussion Google Group (google-stackdr...@googlegroups.com) to participate in discussions with other members of the GoogleStackdriver community.
---
You received this message because you are subscribed to the Google Groups "Google Stackdriver Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-stackdriver-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-stackdriver-discussion/bf7650a2-65af-4686-a74e-2e4047f486adn%40googlegroups.com.


--


Lee Yanco
Senior Product Manager
lya...@google.com

Reply all
Reply to author
Forward
0 new messages