gcp metric explorer using promql
GCP metric explorer supports PromQL. Ideally we should use the UI to help us build our PromQL.
All we need to do is to click on the "Add query" and then we can select the metric that is relevant to us. In this case it is "dns_request_count".
Here is the sample PromQL that is generated.
{"__name__"="kubernetes_io:pod_volume_utilization"}
Memory request utilization over time
avg_over_time({"__name__"="kubernetes.io/container/memory/request_utilization",
Dns request count over time
Add additional criteria
Some common function
rate() turns a counter that only ever grows into a number that tells you how fast it’s growing.
sum(rate(http_requests_total[5m])) - total across everything
sum by (status) (rate(http_requests_total[5m])) - one line per status code
sum without (instance) (rate(...)) - drop one label, keep the rest

Comments