prometheus-community / prometheus-community/stackdriver_exporter

Export Resource Metadata Labels

Open
#115 1 comment 22 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
295
Forks
117
Avg merge
9d 14h
Merged PRs (30d)
7

Description

Background

My company has an internal monitoring/alerting solution that serves both our on-premise
and cloud needs; it's backed by Prometheus and Grafana. We get Cloud Monitoring (née
Stackdriver) metrics into our internal solution using this exporter.

I'm currently building some Grafana graphs for Dataflow jobs.

  • Metric types under the dataflow.googleapis.com
    namespace can be filtered down to a specific Dataflow job using the job_name label
    since this label's value includes the Dataflow job name. (Technically, the job_name
    label is attached to the dataflow_job
    monitored resource type).
  • Metric types under the compute.googleapis.com
    namespace can be filtered down to a specific Dataflow job using the instance_name
    label since this label's value includes the Dataflow job name.
  • Metric types under the agent.googleapis.com
    namespace CANNOT be filtered down to a specific Dataflow job. None of the labels
    include the Dataflow job name. The closest label that gives me what I need is the
    instance_id label that comes attached to the gce_instance monitored resource type.
    instance_id is numeric and there's no way to know what Dataflow job it belongs to.

Because I can't filter down to a specific Dataflow job with the agent.googleapis.com
metric types, I can't build a complete Grafana dashboard that visualizes all the metrics
I care about. Because of this, I still have to go back to using a combination of
Dataflow's Job Metrics UI and Cloud Monitoring's Metrics Explorer UI just to visualize
those metrics alongside others. I'm taking on the overhead of context-switching between
3 different monitoring tools. This slows down any analysis work that I want to do.

Request

As I understand it, in addition to the labels that are attached to metric types and
monitored resource types, Cloud Monitoring also attaches
resource metadata labels
to the monitored resource types. Specifically, the metadata.system_labels.name label
includes the GCE instance name which also includes the Dataflow job name. I would be
able to use this label to filter the agent.googleapis.com metric types down to a
specific Dataflow job.

The Stackdriver exporter doesn't seem to export these resource metadata labels though.

Is there a way we can start exporting these labels by default? Or, add a configuration
that allows users to enable collection of these extra labels?

References:

Happy to be corrected on anything stated here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in collectors/monitoring_collector.go around line 236, the location identified by the issue, and inspect how monitored-resource labels are collected. Determine how resource metadata labels could be exported by default or enabled through configuration; done means the requested labels are available for the relevant metrics without relying on external monitoring tools.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, google-cloud, prometheus
Domain
cloud, observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.