aristanetworks / goarista

Fairly general building blocks used in Arista Go code and open-sourced for the benefit of all.
Apache License 2.0
206 stars 66 forks source link

Feature Request: Dynamic targeting for ocprometheus #58

Open mirceaulinic opened 3 years ago

mirceaulinic commented 3 years ago

At present, when running ocprometheus outside of the switch, the address is provided by running with -address. This makes it a bit less flexible to gather metrics for multiple devices. That is, to have the metrics for, say, switch1, you need to start the app, e.g., ./ocprometheus -addr switch1 -config config.yml; to have the metrics for switch2, you need a separate instance running, e.g., ./ocprometheus -addr switch2 -config config.yml and so on. In other words, when running ocprometheus outside of the switch, it requires as many instances running as switches you have.

Typically, Prometheus exporters accept the target as an argument, e.g., http://prom.example.com/metrics?target=swtich1 for switch1, http://prom.example.com/metrics?target=swtich2 for switch2 etc.

It'd be awesome if we could make the necessary adjustments to accommodate this simplified usage? Thank you!