Search code examples
google-cloud-platformgoogle-cloud-run

Get CPU usage each Google Cloud Run instance


I would like to get the CPU usage for each Cloud Run instance. I can find the CPU usage aggregated for all instances in the Metrics Explorer but I can't split per instance :(. Any ideas?


Solution

  • Let me summarize the discussion with Googlers

    There is no out-of-the-box solution even if Google is aware about the usefulness for troubleshooting. Technically, they cannot do it for every instance due to the very high cardinality of the instanceID label.

    The current workaround is to use OTEL (Open Telemetry), a sidecar collector and Google Managed services for Prometheus to get this additional custom metric.

    https://cloud.google.com/run/docs/tutorials/custom-metrics-opentelemetry-sidecar