gnmic icon indicating copy to clipboard operation
gnmic copied to clipboard

Add support for NetBox target discovery

Open karimra opened this issue 3 years ago • 2 comments

karimra avatar Feb 02 '22 19:02 karimra

Rather than adding Netbox target discovery it would be best for HTTP target discovery to support Prometheus format input. This would allow to use existing APIs made for Prometheus for gnmic. In the case of Netbox, one is already made: https://github.com/FlxPeters/netbox-plugin-prometheus-sd. Also file target discovery could be changed to support Prometheus format discovery as well. Most likely best option is to just add an option in the config, where you can switch between Prometheus format or regular gnmic.

melkypie avatar Feb 08 '22 06:02 melkypie

This is a good idea, I wasn't aware of the prometheus NetBox plugin.

It can be achieved by adding an optional template transformation to both HTTP and File target discovery. Netbox (or any other source producing Prometheus http_sd format) --> Prometheus Format --> Template --> gNMIc Format.

But I think it still makes sense to add a separate NetBox target discovery mechanism using its native API.

I will add a separate issue for tracking the template/Prometheus http_sd format for HTTP and File target discovery.

karimra avatar Feb 08 '22 07:02 karimra