Cloud Monitoring metric names include two components, a domain (such as compute.googleapis.com/) and a path (such as instance/disk/max_read_ops_count). Because PromQL only supports the special characters : and _, you must first make Monitoring metric names compatible with PromQL. To map Monitoring metric names to PromQL, apply the following rules:
- Replace the first
/with:. - Replace all other special characters (including
.and other/characters) with_.
The following table lists some metric names and their Prometheus equivalents:
| Cloud Monitoring metric name | PromQL metric name |
|---|---|
kubernetes.io/container/cpu/limit_cores | kubernetes_io:container_cpu_limit_cores |
compute.googleapis.com/instance/cpu/utilization | compute_googleapis_com:instance_cpu_utilization |