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

[extension/opamp]: Custom Message Support #32281

Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5182859
custom message interface
BinaryFissionGames Mar 27, 2024
b5fd947
opamp custom messages prototype
BinaryFissionGames Apr 1, 2024
3901617
finish registry + tests
BinaryFissionGames Apr 9, 2024
b83d7c1
ensure extension is a valid registry
BinaryFissionGames Apr 9, 2024
0c1fe09
add license
BinaryFissionGames Apr 9, 2024
8b5f549
add check for unregistered in Unregister
BinaryFissionGames Apr 9, 2024
e204bcf
process custom messages with the registry when received.
BinaryFissionGames Apr 10, 2024
47f1987
add chlog
BinaryFissionGames Apr 10, 2024
e277407
add readme section about custom messages
BinaryFissionGames Apr 10, 2024
5ece376
fix lint errors
BinaryFissionGames Apr 10, 2024
4a2d18a
make goporto
BinaryFissionGames Apr 15, 2024
af558b1
fix incorrect tracking issue
BinaryFissionGames Apr 16, 2024
df759d4
Rework interface based on feedback
BinaryFissionGames Apr 17, 2024
c31315c
callback -> listener
BinaryFissionGames Apr 17, 2024
0aa8fba
Revert "callback -> listener"
BinaryFissionGames Apr 17, 2024
9f7de59
Revert "Rework interface based on feedback"
BinaryFissionGames Apr 17, 2024
bcb17e3
refactor to a loose unregister function
BinaryFissionGames Apr 17, 2024
d506ea7
comment/naming cleanup
BinaryFissionGames Apr 17, 2024
07597d3
Refactor into suggested interface
BinaryFissionGames Apr 23, 2024
448cf87
fix typo in readme example
BinaryFissionGames Apr 23, 2024
1847e41
fix spelling error in comment
BinaryFissionGames Apr 23, 2024
2629cf8
Fix readme indentation
BinaryFissionGames Apr 24, 2024
ff42ce1
Fix comments, unexport withMaxQueuedMessages
BinaryFissionGames Apr 24, 2024
281ee8d
add implementation assertions
BinaryFissionGames Apr 24, 2024
0e3d8b1
rename customeMessageSender -> customMessageHandler
BinaryFissionGames Apr 24, 2024
1f8921d
Check channels are empty in multi capability test
BinaryFissionGames Apr 24, 2024
5166988
newCustomMessageSender -> newCustomMessageHandler
BinaryFissionGames Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
custom message interface
  • Loading branch information
BinaryFissionGames committed May 3, 2024
commit 51828597cc82c7c7ca41bbd3df059cb899064205
25 changes: 25 additions & 0 deletions extension/opampextension/custom_messages.go
evan-bradley marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package opampextension

import "github.com/open-telemetry/opamp-go/protobufs"

// CustomMessageCallback is a callback that handles a custom message from opamp.
type CustomMessageCallback func(*protobufs.CustomMessage)

// CustomCapabilityRegistry allows for registering a custom capability that can receive custom messages.
type CustomCapabilityRegistry interface {
// Register registers a new custom capability. Any messages for the capability
// will be received by the given callback asynchronously.
// It returns a handle to a CustomCapability, which can be used to unregister, or send
// a message to the OpAMP server.
Register(capability string, callback CustomMessageCallback) CustomCapability
}

// CustomCapability represents a handle to a custom capability.
// This can be used to send a custom message to an OpAMP server, or to unregister
// the capability from the registry.
type CustomCapability interface {
// SendMessage sends a custom message to the OpAMP server.
SendMessage(messageType string, message []byte) error
// Unregister unregisters the custom capability.
Unregister()
}