Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for CustomCapabilities and CustomMessage (#209)
Implements the recent additions to the spec described in open-telemetry/opamp-spec#132 ### Client CustomCapabilities are added to types.StartSettings and these are sent to the server with ReportFullState or when SetCustomCapabilities is called which will update them. There is currently no separate flag for the server to request them. SetCustomMessage is added to the OpAMPClient interface and will add the CustomMessage to the next message and schedule a send. It reports ErrCustomCapabilityNotSupported if the Capability in the CustomMessage is not supported. This is to ensure that the client sets CustomCapabilities appropriately. ### Server The server implementation is more basic. CustomCapabilities are added to server.Settings and are sent on the first ServerToAgent message (websocket) or on every response (http). I considered adding a flag to allow the client to request them and to avoid returning them on every http response, but I decided to wait for feedback. CustomMessage is available on the ServerToAgent message but it is up to the server implementation to set it on the message before returning from OnMessage or when calling Send. ### Usage I am using this implementation on a branch of BindPlane OP and bindplane-agent and it is working well.
- Loading branch information