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 namePromQL metric name
kubernetes.io/container/cpu/limit_coreskubernetes_io:container_cpu_limit_cores
compute.googleapis.com/instance/cpu/utilizationcompute_googleapis_com:instance_cpu_utilization