prometheus-community / prometheus-community/stackdriver_exporter
Feature Request: Support for GCP User Labels in Stackdriver Prometheus Exporter
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 295
- Forks
- 117
- Avg merge
- 9d 14h
- Merged PRs (30d)
- 7
Description
We are developing a new product to collect Google Cloud resource metrics and push them to Grafana Cloud. During implementation, we noticed that the Stackdriver Prometheus Exporter (prometheus.exporter.gcp) does not expose userlabels from GCP resources.
While the exporter correctly maps Stackdriver metrics and their associated resource labels to Prometheus, custom userLabels defined on GCP resources (e.g., Compute Engine, Cloud SQL) are not included in the exported metrics.
Feature Request:
We would like to request support for exposing userLabels from Google Cloud resources as Prometheus metric labels in the Stackdriver Prometheus Exporter.
Example userLabels:
environment=dev
team=striker
monitoring=true
Benefits / Use Cases:
- Adding support for userLabels would greatly enhance the flexibility and observability of GCP metrics. Key use cases include:
- Dynamically filtering metrics in Prometheus or Grafana using userLabels.
- Creating targeted alerts (e.g., suppress alerts for monitoring=false).
- Grouping and visualizing metrics by team, environment, or service ownership.
Implementation Suggestion:
- Extend the exporter’s logic to fetch userLabels from the resource.labels field for each monitored GCP resource.
- Map these userLabels to Prometheus metric labels during export.
- Provide an optional configuration or flag (e.g., --include-user-labels) to enable or disable this behavior.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by locating the exporter logic that maps GCP resource.labels to Prometheus labels and reviewing how configuration flags are defined; done means userLabels can be optionally exposed without breaking existing metric label behavior, with coverage for the requested resource examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, google-cloud, prometheus
- Domain
- cloud, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100