[extension/opampextension]: Adding AcceptsRestartCommand capability#45056
[extension/opampextension]: Adding AcceptsRestartCommand capability#45056evan-bradley merged 33 commits intoopen-telemetry:mainfrom
Conversation
| } | ||
| if msg.RemoteConfig != nil { | ||
| o.logger.Info("received remote config — sending SIGHUP to reload") | ||
| if err := syscall.Kill(os.Getpid(), syscall.SIGHUP); err != nil { |
There was a problem hiding this comment.
It was discussed sending SIGUSR2 instead of SIGHUP here, but I noticed the collector doesn't currently handle the SIGUSR2 yet the way it currently handles SIGHUP, so that functionality can be added in a future iteration
|
After talking some more with @evan-bradley , i'm going to switch to implementing this under the |
…elemetry-collector-contrib into tv/collector_config_restart
|
Please take a look at the build, fix the CI and mark ready for review again. |
evan-bradley
left a comment
There was a problem hiding this comment.
Thanks for working on this @bvigar.
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
…elemetry-collector-contrib into tv/collector_config_restart
|
@bvigar the PR title mentions |
evan-bradley
left a comment
There was a problem hiding this comment.
Looks good to me, sorry for the long review cycle.
|
Thank you for your contribution @bvigar! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help. |
Description
This changes implements the OpAMP
AcceptsRestartCommandcapability for the extension. This functionality exists in the OpAMP supervisor already, and works by rebooting the collector with the new config file. For this change, the implementation sends the SIGHUP signal to the collector to initiate a safe restart.The intention of adding this functionality is to support reloading updated config in the collector via file or http config provider instead of trying to reload config in memory and potentially rebuild the component graph and swap it out at runtime.
Link to tracking issue
Fixes
Testing
onCommandin the OpAMP agent to validate the SIGHUP is sentDocumentation
extension/opampextension/README.mdto show the support for the new capability