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

Support chained lookups in the generator #757

Merged
merged 2 commits into from
May 13, 2022
Merged

Conversation

stephrdev
Copy link
Contributor

@stephrdev stephrdev commented May 11, 2022

This PR fixes the generator tree code to add lookups as index if the lookup label is used for another lookup. Example configuration to use it for Cisco's Class based QOS (CISCO-CLASS-BASED-QOS-MIB)

modules:
  cisco:
    auth:
      community: public
    walk:
      - interfaces
      - ifXTable
      - 1.3.6.1.4.1.9.9.42
      - 1.3.6.1.4.1.9.9.166
    lookups:
      - source_indexes: [cbQosPolicyIndex, cbQosObjectsIndex]
        lookup: cbQosConfigIndex
      - source_indexes: [cbQosConfigIndex]
        lookup: cbQosCMName
      - source_indexes: [cbQosPolicyIndex]
        lookup: cbQosIfIndex
      - source_indexes: [cbQosIfIndex]
        lookup: ifName
    overrides:
      cbQosConfigIndex:
        ignore: true
      cbQosPolicyIndex:
        ignore: true
      cbQosObjectsIndex:
        ignore: true
      cbQosIfIndex:
        ignore: true

Fixes: #678

@stephrdev
Copy link
Contributor Author

@SuperQ according to the contribution docs I should mention one of the maintainers to get some attention to this PR. :-) If there is anything I can improve here, let me know!

@SuperQ SuperQ changed the title Fix #678 - Generator should be able to properly build chained lookups. Support chained lookups in the generator May 11, 2022
@SuperQ
Copy link
Member

SuperQ commented May 11, 2022

Nice, should we add an example of this to the generator.yml?

@stephrdev
Copy link
Contributor Author

Sure, I'll push an update tomorrow.

@stephrdev
Copy link
Contributor Author

Just update the README for generator.

@SuperQ
Copy link
Member

SuperQ commented May 12, 2022

Looks like the new commit is missing DCO.

You can use git commit -s --amend to add it.

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SuperQ SuperQ merged commit 6e36e46 into prometheus:main May 13, 2022
dmmjy9 pushed a commit to dmmjy9/snmp_exporter that referenced this pull request May 13, 2022
* Fix prometheus#678 - Generator should be able to properly build chained lookups.

Signed-off-by: Stephan Jaekel <[email protected]>

* Extend readme on chained lookups and multi-index lookups.

Signed-off-by: Stephan Jaekel <[email protected]>
dmmjy9 pushed a commit to dmmjy9/snmp_exporter that referenced this pull request May 13, 2022
* Fix prometheus#678 - Generator should be able to properly build chained lookups.

Signed-off-by: Stephan Jaekel <[email protected]>

* Extend readme on chained lookups and multi-index lookups.

Signed-off-by: Stephan Jaekel <[email protected]>
Signed-off-by: Jasper <[email protected]>
SuperQ added a commit that referenced this pull request Nov 21, 2022
* [CHANGE] Update to exporter-toolkit v0.8.1 (#810)
* [FEATURE] Support chained lookups in the generator (#757)
* [ENHANCEMENT] Add per-SNMP packet statistics. (#656)
* [ENHANCEMENT] Add support for aes192c and aes256c privacy protocol (#657)
* [ENHANCEMENT] Support responding from different source address (#702)
* [BUGFIX] Fixes dropped context passing (#634)
* [BUGFIX] Add version flag (#717)
* [BUGFIX] Fix retries in generator (#786)

Signed-off-by: SuperQ <[email protected]>
@SuperQ SuperQ mentioned this pull request Nov 21, 2022
SuperQ added a commit that referenced this pull request Nov 21, 2022
* [CHANGE] Update to exporter-toolkit v0.8.1 (#810)
* [FEATURE] Support chained lookups in the generator (#757)
* [ENHANCEMENT] Add per-SNMP packet statistics. (#656)
* [ENHANCEMENT] Add support for aes192c and aes256c privacy protocol (#657)
* [ENHANCEMENT] Support responding from different source address (#702)
* [BUGFIX] Fixes dropped context passing (#634)
* [BUGFIX] Add version flag (#717)
* [BUGFIX] Fix retries in generator (#786)

Signed-off-by: SuperQ <[email protected]>
SuperQ added a commit that referenced this pull request Nov 22, 2022
* [CHANGE] Update to exporter-toolkit v0.8.1 (#810)
* [FEATURE] Support chained lookups in the generator (#757)
* [ENHANCEMENT] Add per-SNMP packet statistics. (#656)
* [ENHANCEMENT] Add support for aes192c and aes256c privacy protocol (#657)
* [ENHANCEMENT] Support responding from different source address (#702)
* [BUGFIX] Fixes dropped context passing (#634)
* [BUGFIX] Add version flag (#717)
* [BUGFIX] Fix retries in generator (#786)

Signed-off-by: SuperQ <[email protected]>

Signed-off-by: SuperQ <[email protected]>
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

Successfully merging this pull request may close these issues.

Support chained lookups in the generator
2 participants