Update OpAMP client to have additional callback methods#4322
Merged
xrmx merged 7 commits intoopen-telemetry:mainfrom Mar 20, 2026
Merged
Update OpAMP client to have additional callback methods#4322xrmx merged 7 commits intoopen-telemetry:mainfrom
xrmx merged 7 commits intoopen-telemetry:mainfrom
Conversation
herin049
reviewed
Mar 11, 2026
opamp/opentelemetry-opamp-client/src/opentelemetry/_opamp/callbacks.py
Outdated
Show resolved
Hide resolved
xrmx
reviewed
Mar 11, 2026
pmcollins
reviewed
Mar 11, 2026
opamp/opentelemetry-opamp-client/src/opentelemetry/_opamp/agent.py
Outdated
Show resolved
Hide resolved
herin049
requested changes
Mar 13, 2026
opamp/opentelemetry-opamp-client/src/opentelemetry/_opamp/agent.py
Outdated
Show resolved
Hide resolved
xrmx
reviewed
Mar 16, 2026
xrmx
approved these changes
Mar 17, 2026
herin049
approved these changes
Mar 18, 2026
pmcollins
approved these changes
Mar 18, 2026
Contributor
|
For integrations in the distro, could you please also take a look at open-telemetry/opentelemetry-python#4646 ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Update the OpAMP client to use a
Callbacksclass, bringing Python closer to the existing opamp-go and Java opamp-client implementations. Adding a minimal set of callbacks at the moment (on_connect,on_connect_failed,on_error,on_message) with no-op default methods so new callbacks can be added in the future without breaking existing subclasses.Hoping to work on client-side sending of messages after state changes next, which might add some additional callbacks and also allow us to not have to pass
OpAMPAgentinto the callbacks.Also, removed some logging as I found it to be a little verbose while testing (e.g. 100 line traceback logged when can't connect to server) and exception was logged in multiple places. Happy to add back if preferred to keep.
Note: this is a breaking change to the OpAMPAgent constructor (
message_handleris replaced byCallbacks), but the package hasn't been released yet. Some prior discussion on this: #3635 (comment)Type of change
How Has This Been Tested?
Tested with a local sample app (implemented callbacks subclass) and test server
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.