Stackdriver GKE Basic Alerts

208 views
Skip to first unread message

Athreya N Patel

unread,
May 25, 2021, 1:12:08 AM5/25/21
to Google Stackdriver Discussion Forum
GKE Dashboard in Cloud Monitoring does present with lots of metrics and visualisation .
But I couldn't figure out to set up alerts based on the same.

Example:
GKE Dashboard consists of CPU Utilization and Memory Utilization with percentages. But there is no metrics in Metrics Explorer which provides percentages. 
Unable to set alerts based on the metrics provided in GKE Dashboard.

Can anyone please help me with sample MQL queries with respect to CPU utilization/Memory Utilization in percentages in GKE?


Ruxanda Danetiu

unread,
May 25, 2021, 7:36:08 AM5/25/21
to Athreya N Patel, Nathan Johnson, Elizabeth Byerly, Patrick Eaton, Google Stackdriver Discussion Forum

--
© 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/006b10c2-26f2-44aa-8091-776650b49b10n%40googlegroups.com.

Igor Peshansky

unread,
May 25, 2021, 9:20:59 PM5/25/21
to Ruxanda Danetiu, Athreya N Patel, Nathan Johnson, Elizabeth Byerly, Patrick Eaton, Google Stackdriver Discussion Forum
Hi. For CPU, there are container/cpu/limit_utilization and container/cpu/request_utilization. For memory, there are container/memory/limit_utilization and container/memory/request_utilization. They are not percentages, but fractions in the range of 0..1, which are trivially convertible to percentages via scaling.

If those weren't available, you'd compute a ratio of, e.g., container/cpu/core_usage_time to container/cpu/limit_cores (or container/cpu/request_cores, depending on what you need) using any of the MQL ratio examples here.
        Igor

Athreya N Patel

unread,
May 26, 2021, 5:26:53 AM5/26/21
to Google Stackdriver Discussion Forum
Thanks for the reply

I am looking at Node metrics as well.
We see something like this[attached] in UI. How are these calculated?.
As I don't see any metrics related to this. 
If MQL is used for this, can I have an example to calculate CPU utlization of a GKE node?

Screenshot 2021-05-26 at 2.51.08 PM.png

Igor Peshansky

unread,
May 26, 2021, 5:09:10 PM5/26/21
to Athreya N Patel, Google Stackdriver Discussion Forum
I believe it aggregates the per-container metrics I mentioned across all containers on a given node. You should be able to group by metadata.system_labels.node_name to replicate that.
        Igor

Reply all
Reply to author
Forward
0 new messages