YannickOlivier / snp_exporter

A prometheus exporter to fetch values from Imagine SNP (IP Gateway) written in Node.js
Apache License 2.0
5 stars 1 forks source link

Prometheus doesn't natively support the inclusion of dynamic query parameters directly within the metrics_path #2

Open JamesRivers opened 6 months ago

JamesRivers commented 6 months ago

http://192.168.90.191:8080/metrics?instance=192.168.90.23&port=9089 is the metrics path - as mentioned, Prometheus doesn't natively support the inclusion of dynamic query parameters directly within the metrics_path '?' for each target.

Prometheus translated this to be http://192.168.90.191:8080/metrics%3Finstance=192.168.90.23&port=9089.

Can we change this? adjust the application or exporter to interpret different paths?

YannickOlivier commented 6 months ago

If you want, I can also add this route : http://192.168.90.191:8080/metrics/urlSnp/portSnp.

Does that work for you ?

rene7769 commented 5 months ago

Hi James, I found a way to configure this in Prometheus, there is a params option and this worked for me. Many thanks to Yannick this is a very good idea.

I need to add this under my scrape configs: