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
Prev Previous commit
Next Next commit
add readme section about custom messages
  • Loading branch information
BinaryFissionGames committed May 3, 2024
commit e277407a4f669fdac0ee9db7e8145d4d1c278ac4
24 changes: 24 additions & 0 deletions extension/opampextension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,30 @@ extensions:
endpoint: wss:https://127.0.0.1:4320/v1/opamp
```

## Custom Messages

Other components may use a configured OpAMP extension to send and receive custom messages to and from an OpAMP server. Components may use the provided `components.Host` from the Start method in order to get a handle to the registry:

```go
func Start(_ context.Context, host component.Host) error {
ext, ok := host.GetExtensions()[opampExtensionID]
if !ok {
return fmt.Errorf("opamp extension %q does not exist", opampExtensionID)
}
evan-bradley marked this conversation as resolved.
Show resolved Hide resolved

registry, ok := ext.(opampextension.CustomCapabilityRegistry)
if !ok {
return fmt.Errorf("extension %q is not an custom message registry", opampExtensionID)
evan-bradley marked this conversation as resolved.
Show resolved Hide resolved
}

// You can now use registry.Register to register a custom capability
evan-bradley marked this conversation as resolved.
Show resolved Hide resolved

return nil
}
```

See the [custom_messages.go](./custom_messages.go) for more information on the custom message API.

## Status

This OpenTelemetry OpAMP agent extension is intended to support the [OpAMP
Expand Down