Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
patrickjahns opened this issue Sep 24, 2020 · 0 comments
Open

Comments

@patrickjahns
Copy link

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:

case *na_pb.KeyValue_StrValue:
floatVal, err := strconv.ParseFloat(v.GetStrValue(), 64)
if err != nil {
continue
}
fieldValue = floatVal
)

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 Strings to snmp float #46

  2. Move the value of that metric into a label and expose it with a constant value - POC here patrickjahns@039a7af

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant