Skip to content

[cmd/opampsupervisor] chore: Store RemoteConfigStatus in persistent state #40467

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

Conversation

dpaasman00
Copy link
Contributor

@dpaasman00 dpaasman00 commented Jun 3, 2025

Description

  • The last reported RemoteConfigStatus should be stored in the persistent state so that on startup we can more accurately report this. Currently it just reports the hash of the remote config that's on disk and an "Applied" status which may not always be accurate.
  • When we opt to not run the collector because we have an empty config map (performance optimization) we should also be reporting a "Healthy" status since this is what the collector would do if it were ran.
  • Small refactor to the "loadAndWriteInitialMergedConfig" function pulling out the own telemetry config generation. Additionally this function is handling loading the remote config since we no longer need to do so on startup with the status being stored in the persistent state.

Link to tracking issue

Fixes

Testing

  • Unit tests updated
  • e2e updated

Documentation

@dpaasman00 dpaasman00 marked this pull request as ready for review June 3, 2025 19:40
@dpaasman00 dpaasman00 requested review from evan-bradley, atoulme and a team as code owners June 3, 2025 19:40
@dpaasman00 dpaasman00 force-pushed the supervisor-persistently-stores-remotecfgstatus branch from 548570b to f492893 Compare June 4, 2025 12:47
@evan-bradley
Copy link
Contributor

Currently it just reports the hash of the remote config that's on disk and an "Applied" status which may not always be accurate.

I see we pass the remote config status in the OpAMP client start settings. Is this reported right away without starting the Collector?

@dpaasman00
Copy link
Contributor Author

Currently it just reports the hash of the remote config that's on disk and an "Applied" status which may not always be accurate.

I see we pass the remote config status in the OpAMP client start settings. Is this reported right away without starting the Collector?

Yep. This remote config status is reported as soon as the OpAMP client connects to the server. This is where it is defined in the OpAMP-Go code: https://github.com/open-telemetry/opamp-go/blob/main/client/types/startsettings.go#L35-L40

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. Thanks for the additional info.

@dpaasman00
Copy link
Contributor Author

Marking as draft for a bit. Found one edge case issue this should fix but doesn't.

@dpaasman00 dpaasman00 marked this pull request as draft June 4, 2025 19:21
@dpaasman00 dpaasman00 marked this pull request as ready for review June 4, 2025 20:12
@dpaasman00
Copy link
Contributor Author

This is ready to go again. Found an edge case when getting sent an empty config we'd report an unhealthy status when we don't want to. Updated an e2e test to make sure it's healthy.

Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

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

@evan-bradley can you take one last look after the latest change?

EDIT: I've marked this PR with do-not-merge, @evan-bradley please take the label off and merge when you take a look.

@dpaasman00
Copy link
Contributor Author

This is ready for another look.

@evan-bradley evan-bradley merged commit c5356cd into open-telemetry:main Jun 9, 2025
186 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 9, 2025
rockdaboot pushed a commit to rockdaboot/opentelemetry-collector-contrib that referenced this pull request Jun 10, 2025
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