Skip to content

[cmd/opampsupervisor] Only report applying if config is changed #39500

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

Merged

Conversation

dpaasman00
Copy link
Contributor

Description

Right now, the Supervisor will always report to the OpAMP server an "Applying" status when it receives a remote config (assuming there's no issue building the merged config). This is a problem because if the new config is not different from the current config, the Supervisor never restarts the Collector with the new config and the status "Applied" is never reported to the server.

This change makes it so the Supervisor only reports the "Applying" status to the OpAMP server if the new config is different from the current and we intend to apply and restart the Collector.

Link to tracking issue

Fixes

Testing

Documentation

} else {
}
if configChanged {
// only report applying if the config has changed and will run agent with new config
Copy link
Contributor

Choose a reason for hiding this comment

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

would you please add a test to cover this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a unit test for this case

@atoulme atoulme marked this pull request as draft April 21, 2025 23:15
@atoulme
Copy link
Contributor

atoulme commented Apr 21, 2025

Moving to draft so you can address adding a test. Please mark ready for review once added.

@dpaasman00 dpaasman00 force-pushed the fix/supervisor-dont-report-applying branch from 6ad2c53 to 3fe4466 Compare April 24, 2025 15:12
@dpaasman00 dpaasman00 marked this pull request as ready for review April 24, 2025 17:07
@dpaasman00 dpaasman00 force-pushed the fix/supervisor-dont-report-applying branch from 41a260e to 4e4ea74 Compare April 24, 2025 18:08
@dpaasman00 dpaasman00 force-pushed the fix/supervisor-dont-report-applying branch from 4e4ea74 to b005e20 Compare April 24, 2025 18:17
@atoulme atoulme merged commit c35544d into open-telemetry:main Apr 25, 2025
173 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 25, 2025
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 6, 2025
…-telemetry#39500)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Right now, the Supervisor will always report to the OpAMP server an
"Applying" status when it receives a remote config (assuming there's no
issue building the merged config). This is a problem because if the new
config is not different from the current config, the Supervisor never
restarts the Collector with the new config and the status "Applied" is
never reported to the server.

This change makes it so the Supervisor only reports the "Applying"
status to the OpAMP server if the new config is different from the
current and we intend to apply and restart the Collector.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 20, 2025
…-telemetry#39500)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Right now, the Supervisor will always report to the OpAMP server an
"Applying" status when it receives a remote config (assuming there's no
issue building the merged config). This is a problem because if the new
config is not different from the current config, the Supervisor never
restarts the Collector with the new config and the status "Applied" is
never reported to the server.

This change makes it so the Supervisor only reports the "Applying"
status to the OpAMP server if the new config is different from the
current and we intend to apply and restart the Collector.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
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.

4 participants