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

Allow the setting of labels for snmp exporter for both target and targets #1876

Merged
merged 5 commits into from
Oct 11, 2024

Conversation

mattdurham
Copy link
Collaborator

@mattdurham mattdurham commented Oct 11, 2024

PR Description

This allows setting of labels in both the target and targets fields

Which issue(s) this PR fixes

Fixes #1324

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated

@mattdurham mattdurham marked this pull request as ready for review October 11, 2024 13:16
Copy link
Contributor

@wildum wildum left a comment

Choose a reason for hiding this comment

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

thanks for fixing this, it's hard to follow when there are two inputs called target and the output is also target. Hopefullly at some point we can get rid of the target block to simplify it

@mattdurham
Copy link
Collaborator Author

Target and Address are both pretty overused terms. In snmp.go the handler refers to target but its actually address which means the snmpTargets always fails for self scraping, but I loath to fix it because if someone is manually targeting it then it might break a behavior. Though I may fix it in a subsequent PR since our component API isnt covered by backwards compatibility.

@mattdurham mattdurham merged commit dbda546 into main Oct 11, 2024
17 of 18 checks passed
@mattdurham mattdurham deleted the allow_labels_snmp branch October 11, 2024 15:10
pbailhache pushed a commit to pbailhache/alloy that referenced this pull request Oct 17, 2024
…gets (grafana#1876)

* Allow the setting of labels for snmp exporter, both in the hardcoded manner and also in the labels manner.

* Simplify snmp exporter

* Add tests.

* Remove name.

* PR feedback
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.

Add labels map to SNMP Exporter
2 participants