jtimon icon indicating copy to clipboard operation
jtimon copied to clipboard

[Feature Request] convert string/enum values for prometheus exporter

Open patrickjahns opened this issue 3 years ago • 0 comments

We are currently using jtimon to monitor some juniper routers - with some caveats this is working fairly well.

For sensors that expose strings or enums, the exporter will omit them (see: https://github.com/nileshsimaria/jtimon/blob/32fb1319a8c88df0a7c4209ff9cc4bb99b9e7a64/prometheus_exporter.go#L153-L158 )

In certain cases, it would be great to be able to convert these values and expose them. For example the bgp session-state sensor at /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/state/session-state exposes a ENUM (see screenshot below from explorer)

image

It would be great to expose those as metrics.

From the tip of my head, I see two viable options:

  1. Provide a mapping for certain paths to ENUM values, a approach was done at https://github.com/nileshsimaria/jtimon/pull/46

  2. Move the value of that metric into a label and expose it with a constant value - POC here https://github.com/patrickjahns/jtimon/commit/039a7aff360932a00c947ead22eb6d19f4d435a5

It would be great to receive quick feedback which the preferred option would be - I am happy to provide a pull request for this

patrickjahns avatar Sep 24 '20 19:09 patrickjahns