-
Notifications
You must be signed in to change notification settings - Fork 236
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
feat(prom/exp/snmp): add support to pass multiple SNMP config files to prometheus.exporter.snmp
#967
base: main
Are you sure you want to change the base?
Conversation
…o `prometheus.exporter.snmp` Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
…ument Signed-off-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
Hi, |
I think it does! Not yet testing it though (actually im waiting for the integration test for snmp got merged first) |
|
||
The `config_file` argument points to a YAML file defining which snmp_exporter modules to use. | ||
Refer to [snmp_exporter](https://github.com/prometheus/snmp_exporter#generating-configuration) for details on how to generate a configuration file. | ||
|
||
Each file listed in in the `config_files` argument must conform to the `config_file` requirements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each file listed in in the `config_files` argument must conform to the `config_file` requirements. | |
Each file listed in in the `config_files` argument must conform to the `config_file` requirements. | |
Only one of `config_file` or `config_files` can be provided. |
SnmpConfigFile: a.ConfigFile, | ||
SnmpConfigFiles: a.ConfigFiles, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be simpler if we return an error if both config_files
and config_file
are specified. In this function we could create a config_files
out of a config_file
, and only pass config_files
to snmp_exporter.Config
. The static mode code doesn't need to support config_file
because it's not used in Alloy.
This PR has not had any activity in the past 30 days, so the |
Will this get merged sometime in the future? really lookin forward to use multiple files instead of prejoining the files i generated into one large file, with mixed config&secrets. |
PR Description
Which issue(s) this PR fixes
Closes #916
Notes to the Reviewer
I decided not to add another test case into
snmp_test.go
as it doesn't test whole component with argument but rather just a unit test forLoadSNMP
function. Incoming integration test in #954 will address this.PR Checklist