Skip to content

[extension/opampextension]: Adding AcceptsRestartCommand capability#45056

Merged
evan-bradley merged 33 commits intoopen-telemetry:mainfrom
bvigar:tv/collector_config_restart
Jan 28, 2026
Merged

[extension/opampextension]: Adding AcceptsRestartCommand capability#45056
evan-bradley merged 33 commits intoopen-telemetry:mainfrom
bvigar:tv/collector_config_restart

Conversation

@bvigar
Copy link
Contributor

@bvigar bvigar commented Dec 18, 2025

Description

This changes implements the OpAMP AcceptsRestartCommand capability 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

  • Added unit test for the changes to onCommand in the OpAMP agent to validate the SIGHUP is sent
  • I haven't done any e2e testing locally yet, I plan to in the next few days

Documentation

  • Updated the extension/opampextension/README.md to show the support for the new capability

@bvigar bvigar marked this pull request as ready for review December 18, 2025 21:45
@github-actions github-actions bot requested a review from portertech December 18, 2025 21:45
}
if msg.RemoteConfig != nil {
o.logger.Info("received remote config — sending SIGHUP to reload")
if err := syscall.Kill(os.Getpid(), syscall.SIGHUP); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bvigar
Copy link
Contributor Author

bvigar commented Dec 19, 2025

After talking some more with @evan-bradley , i'm going to switch to implementing this under the AgentCapabilities_AcceptsRestartCommand capability instead. I'm also going to add a feature gate to put this behind, so standby. I'll move this to draft in the meantime.

@bvigar bvigar marked this pull request as draft December 19, 2025 17:07
@bvigar bvigar marked this pull request as ready for review December 22, 2025 20:05
@atoulme
Copy link
Contributor

atoulme commented Dec 31, 2025

Please take a look at the build, fix the CI and mark ready for review again.

@atoulme atoulme marked this pull request as draft December 31, 2025 23:44
@bvigar bvigar requested a review from douglascamata January 12, 2026 16:21
Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @bvigar.

@bvigar bvigar requested a review from evan-bradley January 12, 2026 21:00
bvigar and others added 5 commits January 14, 2026 10:11
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>
@bvigar bvigar requested a review from evan-bradley January 14, 2026 15:23
@douglascamata
Copy link
Member

@bvigar the PR title mentions AtteptsRemoteConfig capability, but the PR itself is implementing AcceptsRestartCommand. Could you update the title please to avoid confusion?

@bvigar bvigar changed the title [extension/opampextension]: Adding AcceptsRemoteConfig capability [extension/opampextension]: Adding AcceptsRestartCommand capability Jan 15, 2026
Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, sorry for the long review cycle.

@evan-bradley evan-bradley merged commit 8be9e73 into open-telemetry:main Jan 28, 2026
191 checks passed
@otelbot
Copy link
Contributor

otelbot bot commented Jan 28, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants