Stackdriver / stackdriver-prometheus-sidecar

A sidecar for the Prometheus server that can send metrics to Stackdriver.
https://cloud.google.com/monitoring/kubernetes-engine/prometheus
Apache License 2.0
120 stars 43 forks source link

Export more metric labels #231

Open nambrot opened 4 years ago

nambrot commented 4 years ago

Howdy, I was wondering if it is possible to configure the sidecar to export some specific labels of our metrics? Or are we constrained to the generic task resource labels in Stackdriver?

igorpeshansky commented 4 years ago

The sidecar supports a number of resources, all of which are listed in resource_map.go. Most of the other labels are attached to the timeseries, except for the target labels and __name__ (see series_cache.go). Does this answer your question?

nambrot commented 4 years ago

Thank you for your prompt response! I'm not entirely sure I understand the Resource Map. When we have run it on our cluster, it's been translated to a Generic Task. If I understand correctly, if I have some application specific metrics, that will be my best shot and using job and task_id as the only free labels I could use for my purposes?

nambrot commented 4 years ago

The reason I ask is that with prometheus-to-sd I was able to get all the labels from my prometheus metrics into stackdriver as well

nambrot commented 4 years ago

@igorpeshansky Just wondering if you had any updates/tips here?

WaterKnight1998 commented 3 years ago

@nambrot Same happening here. If I mount prometheus-to-sd I get metrics (kube-state-metrics & Node exporter) from all namespaces in GCP Monitoring. However, If I use this sidecar I don´t get them from all namespaces.

How did you solve this error?

clguo-tw commented 3 years ago

same problem, can't get metrics from all namespaces only get metrics from namespace which has prometheus