Skip to content
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

[cmd/opampsupervisor] Receive and report effective config #31641

Conversation

evan-bradley
Copy link
Contributor

@evan-bradley evan-bradley commented Mar 7, 2024

Link to tracking Issue: Resolves #30622

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Mar 22, 2024
Copy link
Contributor

github-actions bot commented Apr 6, 2024

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Apr 6, 2024
@evan-bradley evan-bradley reopened this Apr 11, 2024
@evan-bradley evan-bradley force-pushed the supervisor-effective-config branch 2 times, most recently from 9b31b09 to 7e60da3 Compare April 11, 2024 19:56
@evan-bradley evan-bradley marked this pull request as ready for review April 11, 2024 21:59
@github-actions github-actions bot removed the Stale label Apr 12, 2024
cmd/opampsupervisor/supervisor/supervisor.go Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
if message.EffectiveConfig != nil {
s.logger.Debug("Setting confmap")
fmt.Println(string(message.EffectiveConfig.ConfigMap.ConfigMap[""].Body))
s.effectiveConfig.Store(string(message.EffectiveConfig.ConfigMap.ConfigMap[""].Body))
Copy link
Member

Choose a reason for hiding this comment

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

Can we safely assume that the entire config is reported this way? Or should we iterate on the map and merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a bit of an open question. I will open an issue in the spec repo to link to here and we can use that as a starting point for discussion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@BinaryFissionGames BinaryFissionGames left a comment

Choose a reason for hiding this comment

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

Tested this a bit against BindPlane, it was able to correctly receive and report the config.

Only issue I ran into is that if the OpAMP server does not offer an a config with a key of "", the supervisor will panic. I think that can be addressed in a completely separate PR, though.

cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
.chloggen/supervisor-effective-config.yaml Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Outdated Show resolved Hide resolved
cmd/opampsupervisor/supervisor/supervisor.go Show resolved Hide resolved
traces:
receivers: [nop]
exporters: [nop]
extensions: [opamp]
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this doesn't need the extensions portion here, the final config ends up with the opamp extension defined twice.

Comment on lines -741 to 855
if s.effectiveConfig.Load().(string) != newEffectiveConfig {
if s.mergedConfig.Load().(string) != newEffectiveConfig {
s.logger.Debug("Effective config changed.")
s.effectiveConfig.Store(newEffectiveConfig)
s.mergedConfig.Store(newEffectiveConfig)
configChanged = true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like existing behavior, but is mergedConfig being modified concurrently?

If it is, shouldn't this Load and Store both happen atomically (e.g. using Swap)?

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label May 18, 2024
evan-bradley added a commit that referenced this pull request Jun 3, 2024
**Description:** <Describe what has changed.>

Redacts primitive values in the effective config reported by the
extension.

Necessary for
#31641
until
open-telemetry/opentelemetry-collector#10139 is
resolved.

Relates to
#32983
@evan-bradley
Copy link
Contributor Author

Closing in favor of #33462.

evan-bradley added a commit that referenced this pull request Jun 13, 2024
**Description:**
Adds the ability to receive and run remote configurations from an OpAMP
server, as well as to report the remote configuration status.

This PR is just bringing #31641 up-to-date.

**Link to tracking Issue:** Resolves #30622

**Testing:** <Describe what testing was performed and which tests were
added.>
Unit tests

**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Evan Bradley <evan-bradley@users.noreply.github.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
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.

[cmd/opampsupervisor] Get the effective config from the OpAMP extension
5 participants