-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add support for multiple config arguments #1576
Conversation
@crobert-1 can you please take a look at the failing integration test |
78843a8
to
aa48708
Compare
f56a20c
to
aa48708
Compare
|
I'd strongly recommend adding an integration test that uses multiple configs to be able to better vet this over time. Maybe one file for a host metrics receiver, one for a processor, and another for an exporter? |
4551b27
to
fa39693
Compare
Added an integration test to cover this case, thanks! |
b97b5f3
to
1150486
Compare
1150486
to
64f2a02
Compare
The core distribution of the collector now supports multiple "--config" input arguments, so this change updates the Splunk distro to also support this. Testing has also been added to ensure the config server works for multiple files, flag parsing works as expected, and the collector can properly use multiple input config files.
Moving the flags into a single encapsulated struct helps organization of variables and testability of the code.
- Encapsulate flags in single structure - Remove getter methods that don't have any extra value - Handle invalid flags passed in - Mark variable as const - Update CHANGELOG
- Comment why CLI flag usage strings are empty - Remove go import replace statement - Assert error contents in tests
-Add locking to config server so it doesn't need to be shutdown and restarted, but can just be started and use references to serve configs. - Add integration test to make sure collector can be run with multiple config files
64f2a02
to
8bca9be
Compare
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.
Thanks!
The core distribution of the collector now supports multiple "--config" input arguments, so this change updates the Splunk
distro to also support this. This change also adds new flag parsing functionality to use golang's flag library, instead of manual parsing. Testing has also been added to ensure the config server works for multiple files, flag parsing works as expected, and the collector can properly use multiple input config files.