[opamp-client] Add the ability to receive custom messages#2990
Open
breedx-splk wants to merge 7 commits into
Open
[opamp-client] Add the ability to receive custom messages#2990breedx-splk wants to merge 7 commits into
breedx-splk wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds OpAMP “custom messages” support to the opamp-client by letting clients advertise supported custom capabilities in AgentToServer.custom_capabilities, and by surfacing ServerToAgent.custom_message through the existing onMessage callback payload.
Changes:
- Introduces builder support for reporting custom capabilities (
addCustomCapability) and plumbs this through client state and request field mapping. - Extends
MessageDataand response handling soServerToAgent.custom_messagetriggersCallbacks.onMessage(...)with a populatedcustomMessage. - Adds/updates tests to validate custom capabilities reporting and custom message callback behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| opamp-client/src/test/java/io/opentelemetry/opamp/client/internal/impl/recipe/AgentToServerAppendersTest.java | Updates appender mapping test to include CUSTOM_CAPABILITIES. |
| opamp-client/src/test/java/io/opentelemetry/opamp/client/internal/impl/OpampClientStateTest.java | Updates state test wiring to include State.CustomCapabilities. |
| opamp-client/src/test/java/io/opentelemetry/opamp/client/internal/impl/OpampClientImplTest.java | Adds tests for sending custom capabilities and receiving custom messages. |
| opamp-client/src/main/java/io/opentelemetry/opamp/client/OpampClientBuilder.java | Adds addCustomCapability(...) and includes custom capabilities in initial state. |
| opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/state/State.java | Adds State.CustomCapabilities state holder with new Field type. |
| opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/response/MessageData.java | Extends callback payload to include CustomMessage. |
| opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/request/Field.java | Adds CUSTOM_CAPABILITIES request field identifier. |
| opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/impl/recipe/AgentToServerAppenders.java | Wires a new appender slot for CUSTOM_CAPABILITIES. |
| opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/impl/OpampClientState.java | Adds custom capabilities to the aggregated client state. |
| opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/impl/OpampClientImpl.java | Adds compression/wiring for custom capabilities and handles custom_message in responses. |
Comments suppressed due to low confidence (1)
opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/response/MessageData.java:17
- The class-level Javadoc says this message data is for "status changes", but
MessageDatanow also carries custom messages. Updating the wording would make the API clearer for callback implementers.
/**
* Data class provided in {@link OpampClient.Callbacks#onMessage(OpampClient, MessageData)} with
* Server's provided status changes.
*/
LikeTheSalad
approved these changes
Jul 14, 2026
jackshirazi
reviewed
Jul 15, 2026
jackshirazi
reviewed
Jul 15, 2026
…nal/impl/OpampClientImplTest.java Co-authored-by: jackshirazi <jacks@fasterj.com>
…ClientBuilder.java Co-authored-by: jackshirazi <jacks@fasterj.com>
…nal/impl/recipe/appenders/CustomCapabilitiesAppender.java Co-authored-by: jackshirazi <jacks@fasterj.com>
jackshirazi
approved these changes
Jul 15, 2026
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.
The OpAMP protocol declares the ability to support custom messages.
This PR adds this custom capability. For users, it will look something like this:
Disclaimer: made mostly with codex...but I support it.