prometheus-community / prometheus-community/stackdriver_exporter

No metrics from compute_engine

Open
#46 5 comments 0 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

Hi,

Using latest stackdriver_exporter, I seem to have ran into an issue extracting metrics from Stackdriver.

I use a service account with the Monitoring Viewer role that I inject into a docker container.

docker run --rm -it -p 9255:9255  \
  -e GOOGLE_APPLICATION_CREDENTIALS=/certs/flames-dev-monitoring-stackdriver-sa.json \
  -e STACKDRIVER_EXPORTER_GOOGLE_PROJECT_ID="flames-dev" \
  -e STACKDRIVER_EXPORTER_MONITORING_METRICS_TYPE_PREFIXES="compute.googleapis.com/instance,pubsub.googleapis.com/subscription,redis.googleapis.com/stats" \
  -e STACKDRIVER_EXPORTER_MONITORING_METRICS_INTERVAL="1m" \
  -v /local/git/flames/flames-infrastructure-k8s-addons/workspace/json-sa/:/certs/ \
  frodenas/stackdriver-exporter --log.level="debug"

On port 9255/metrics, I can see that many pubsub metrics are available. E.g.

stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_retained_acked_messages{project_id="flames-dev",subscription_id="flames-service-event%us-central1%event-source-subscription",unit="1"} 0
stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_retained_acked_messages{project_id="flames-dev",subscription_id="flames-service-subscription%no-region%event-source-subscription",unit="1"} 0
stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_retained_acked_messages{project_id="flames-dev",subscription_id="gcf-cloudBuildSlackIntegration-cloud-builds",unit="1"} 0
stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_retained_acked_messages{project_id="flames-dev",subscription_id="gcf-orchestrationMWInitialStepTransform-orchestration.mw_step_convert",unit="1"} 0
stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_retained_acked_messages{project_id="flames-dev",subscription_id="gcr-triggers",unit="1"} 0
stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_retained_acked_messages{project_id="flames-dev",subscription_id="pp_mp_file_sub",unit="1"} 0
stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_retained_acked_messages{project_id="flames-dev",subscription_id="spinnaker",unit="1"} 0
stackdriver_pubsub_subscription_pubsub_googleapis_com_subscription_num_retained_acked_messages{project_id="flames-dev",subscription_id="spinnaker-gcr",unit="1"} 0

There are no errors from the stackdriver_exporter prometheus counter:

# HELP stackdriver_monitoring_last_scrape_error Whether the last metrics scrape from Google Stackdriver Monitoring resulted in an error (1 for error, 0 for success).
# TYPE stackdriver_monitoring_last_scrape_error gauge
stackdriver_monitoring_last_scrape_error{project_id="flames-dev"} 0

But, there are no metrics from either redis or compute.

I also tried with the example in the stackdriver_exporter, --monitoring.metrics-type-prefixes "compute.googleapis.com/instance/cpu,compute.googleapis.com/instance/disk" and do not get any values or instances.

What am I doing wrong?

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 by reproducing the supplied docker run and inspecting the exporter’s debug output while requesting the compute, Redis, and Pub/Sub metric prefixes. Compare the Google Cloud project, service-account permissions, and available resources for each service; done means identifying why compute and Redis return no values and documenting or correcting the behavior with a verified metrics response.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go, google-cloud, prometheus
Domain
cloud, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.