grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
1.43k stars 210 forks source link

prometheus.exporter.snmp to support multiple config files #916

Open ptodev opened 6 months ago

ptodev commented 6 months ago

Request

The config_file (and maybe config) options can be changed from string to list(string), so that users can specify more than one config file. This is a feature which was added upstream some time ago.

This was requested by @bastischubert

Use case

It could be helpful to split out a config file into multiple files.

rfratto commented 6 months ago

Is there a way that this can be done without a breaking change, like a new config_files argument that becomes mutually exclusive with the config_file argument?

hainenber commented 5 months ago

That's also more intuitive, imo. From user perspective, it'd be pretty weird passing a list of SNMP config files to config_file rather config_files

Or maybe we can mark config_file as deprecated and enforce people passing single-entry list of SNMP config file to config_files? 🤔

ptodev commented 5 months ago

Is there a way that this can be done without a breaking change, like a new config_files argument that becomes mutually exclusive with the config_file argument?

I would be happy with that. I also think we should document the config_file argument as "deprecated", as @hainenber suggested. Having both arguments side by side will give people time to migrate prior to 2.0.

From user perspective, it'd be pretty weird passing a list of SNMP config files to config_file rather config_files

True! It was sort of implied in the original issue above, but I didn't mention it. Thanks for clearing it. up :)

Btw I don't think this is super high priority, because in theory config_file accepts a glob pattern. So even with the current config it should be possible for folks to use multiple files. I haven't tested it though. Hopefully we can use the integration tests in #954 for this purpose in the future.

github-actions[bot] commented 4 months ago

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it. If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue. The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity. Thank you for your contributions!

colinedwardwood commented 1 month ago

I'd like this feature for my customers. They want parity with the upstream and it just makes life a lot easier for them to maintain configs separately based on all kinds of things like manufacturers and auth.