Add the posbility to use a static index for some lookup#1445
Open
earendilfr wants to merge 3 commits intoprometheus:mainfrom
Open
Add the posbility to use a static index for some lookup#1445earendilfr wants to merge 3 commits intoprometheus:mainfrom
earendilfr wants to merge 3 commits intoprometheus:mainfrom
Conversation
- add the possibility to indicate a custom label name for a specific oid - add the possibility to indicate a static number as index for a specific oid Signed-off-by: earendilfr <[email protected]>
51ff04d to
8e8f8c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some specific case, it could be useful to be able to perform a lookup with a static indexes.
By example, I have the case with the COS monitoring for Cisco devices:
we have two labels that could be interresting to add to the monitored OID:
cbQosCMNamecbQosPolicyMapNamethe first one is very easy to lookup (we juste do as indicated in the example
but for the second one, it's a little more tricky:
the interesting part for this one it's to have the Policy-Name attached to the interface.
To do that, we need to do a lookup to the oid
cbQosConfigIndexwith the indexescbQosPolicyIndexand the index1.So, the patch change to part:
snmp-generator:in this case, it's mandatorry because we need to add a dedicated index related to
cbQosConfigIndexforcbQosPolicyMapNamebut it's should not be the same than the index used forcbQosCMNamesnmp_exporter:You can found just bellow an example of the config I have tried in my environment: