Skip to content

Feature Request: Support for GCP User Labels in Stackdriver Prometheus Exporter #469

@spotadarsp

Description

@spotadarsp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions