-
Notifications
You must be signed in to change notification settings - Fork 41
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(build): use the builder to set config providers #1587
Conversation
84421a2
to
46aed61
Compare
cd cmd && go get github.com/SumoLogic/sumologic-otel-collector/pkg/configprovider/globprovider@v0.0.0-00010101000000-000000000000 | ||
cd cmd && go get github.com/SumoLogic/sumologic-otel-collector/pkg/configprovider/opampprovider@v0.0.0-00010101000000-000000000000 |
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.
Very happy to see these lines removed 🎉
Converting to draft until I figure out how the service registration should work. I think it should just work with the upstream service handler, but that's not actually the case. |
46aed61
to
5379591
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.
Nice cleanup. Also validated that it works as a Windows service.
5379591
to
d1a4fda
Compare
d1a4fda
to
49ce573
Compare
The builder now supports setting config providers and converters via its configuration. Use that instead of our own patches. This change gets rid of a bunch of custom build code. We only keep the flags necessary to check if
--remote-config
and--config
haven't been set at the same time.I've also removed our custom Windows service code. The Windows service initialization in core now behaves very similarly to starting the collector normally, so doing the same thing gives the right result. One modification I had to make was deleting the opamp flag from
os.Args
, as the service handler callsflags.Parse
, which errors on unknown flags, and there isn't a way to add our custom flag there.Removing the custom windows code makes our custom
--remote-config
flag not appear in the help text when running as a Windows service, but I think that's worth it in return for being able to use the upstream service handler.Resolves #1565