prometheus-rsocket-proxy icon indicating copy to clipboard operation
prometheus-rsocket-proxy copied to clipboard

Clients SHOULD have unique metric IDs (name + tags)

Open shakuzen opened this issue 5 years ago • 2 comments

If multiple applications/instances use the client and are scraped by the proxy application but they use the same metric names and tags, there will be duplicate time series in the Prometheus scrape (possibly with different values). Prometheus will only store one of these time series. The instance or job labels Prometheus adds will not help here because they will correspond to the Proxy application, not the Client application.

shakuzen avatar Jul 19 '19 04:07 shakuzen

For my demo application on CF, I'm using following properties which are compatible with Promregator

management.metrics.tags.org_name=demo
management.metrics.tags.space_name=${cloud.application.space_name:demo}
management.metrics.tags.app_name=${cloud.application.application_name:demo}
management.metrics.tags.cf_instance_id=${cloud.application.application_id:demo}:${cloud.application.instance_index:0}
management.metrics.tags.cf_instance_number=${cloud.application.instance_index:0}

https://github.com/making/demo-micrometer/blob/master/src/main/resources/application.properties#L8-L12

making avatar Jul 19 '19 05:07 making

Maybe I am also not fully understanding how this proxy is supposed to work, but here my problem: There are 2 apps emitting the same metrics behind a proxy. Now going to the proxy's /metrics/connected endpoint will yield one big list with both apps' metrics. Do I have any chance from there on to identify which metric is coming from which app?

ToWi87 avatar Jul 21 '20 12:07 ToWi87