A Prometheus Exporter for Google Cloud Monitoring metrics.
- Export metrics from GCP Cloud Monitoring to Prometheus
- Simple configuration of metrics using metric type prefixes
- Auto discovery of resources via tags
- Adds any available dimension labels to metrics
The exporter is configured to use Google Application Default Credentials to authenticate with Google Cloud Monitoring.
The exporter is configured using a YAML file. The following options are available:
Option | Description |
---|---|
project_id |
The Google Cloud project ID to export metrics from. |
metric_type_prefixes |
A list of metric type prefixes to export. |
Option | Description |
---|---|
user_labels |
User-defined labels to filter on. |
project_id: "massdriver"
metric_type_prefixes:
- "cloudsql.googleapis.com/database/cpu"
user_labels:
environment: "prod"
By default, the exporter is exposed on port 9090
, path /metrics
.
Metrics are queried at the time of scraping and are not cached.
To adhere to the Prometheus data model, metric names are converted to snake case and all non-alphanumeric characters are replaced with underscores.
For example, the metric cloudsql.googleapis.com/database/cpu/utilization
will be exported as cloudsql_googleapis_com_database_cpu_utilization
.
All metrics are exported as gauges, and the #HELP comment is set to the metric's description as supplied by the GCP Cloud Monitoring API.
Images for the exporter are available on Docker Hub.
An example docker-compose file is included in this repository. It requires a config.yml
and GCP credentials.json
in the directory.
After starting the exporter with docker-compose up
, metrics will be available at http://localhost:9090/metrics
.
The docker file can be used to deploy the exporter to any container runtime - we use Kubernetes.
- Currently no support for Distributions.
If you have any questions or suggestions, please open an issue! We'd love to hear from you.