-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[cmd/opampsupervisor] Add OpAMP supervisor skeleton #19143
Merged
codeboten
merged 17 commits into
open-telemetry:main
from
evan-bradley:opamp-supervisor
Jun 14, 2023
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
583d06f
Add OpAMP supervisor skeleton
evan-bradley 63a9488
Add specification document converted from Markdown
evan-bradley 61ef95c
Address PR feedback and add issues
evan-bradley f759c9b
Fix lint issues
evan-bradley d5cddf6
Fix error handling
evan-bradley 1db1af9
Remove unnecessary channel
evan-bradley 67ec60c
Get rid of process startup/shutdown timing errors
evan-bradley fda4237
Remove waitCh
evan-bradley e7b84a4
Update cmd/opampsupervisor/specification/README.md
evan-bradley fb9dd4f
Update cmd/opampsupervisor/specification/README.md
evan-bradley 0e4e033
Address PR feedback
evan-bradley 5a24be9
Fix lint
evan-bradley 007abef
Fix lint
evan-bradley 082bed1
Fix lint
evan-bradley 4fbeefc
Address PR feedback
evan-bradley 95329e1
Switch to use zap.SugaredLogger for the OpAMP client's logger
evan-bradley ea0ed54
make gendependabot
evan-bradley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
effective.yaml | ||
agent.log |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../../Makefile.Common |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# OpAMP Supervisor for the OpenTelemetry Collector | ||
|
||
This is an implementation of an OpAMP Supervisor that runs a Collector instance using configuration provided from an OpAMP server. This implementation | ||
is following a design specified [here](./specification/README.md). | ||
The design is still undergoing changes, and as such this implementation may change as well. | ||
|
||
## Experimenting with the supervisor | ||
|
||
The supervisor is currently undergoing heavy development and is not ready for any serious use. However, if you would like to test it, you can follow the steps below: | ||
|
||
1. Download the [opamp-go](https://github.com/open-telemetry/opamp-go) repository, and run the OpAMP example server in the `internal/examples/server` directory. | ||
2. From the Collector contrib repository root, build the Collector: | ||
|
||
```shell | ||
make otelcontribcol | ||
``` | ||
|
||
3. Run the supervisor, substituting `<OS>` for your platform: | ||
|
||
```shell | ||
go run . --config testdata/supervisor_<OS>.yaml | ||
``` | ||
|
||
4. The supervisor should connect to the OpAMP server and start a Collector instance. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/opampsupervisor | ||
|
||
go 1.19 | ||
|
||
require ( | ||
github.com/cenkalti/backoff/v4 v4.2.0 | ||
github.com/knadh/koanf v1.5.0 | ||
github.com/oklog/ulid/v2 v2.1.0 | ||
github.com/open-telemetry/opamp-go v0.6.0 | ||
go.uber.org/zap v1.24.0 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/fsnotify/fsnotify v1.6.0 // indirect | ||
github.com/gorilla/websocket v1.5.0 // indirect | ||
github.com/mitchellh/copystructure v1.2.0 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/mitchellh/reflectwalk v1.0.2 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/stretchr/testify v1.8.2 // indirect | ||
go.uber.org/atomic v1.7.0 // indirect | ||
go.uber.org/multierr v1.6.0 // indirect | ||
golang.org/x/sys v0.5.0 // indirect | ||
google.golang.org/protobuf v1.28.1 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
"os" | ||
"os/signal" | ||
|
||
"go.uber.org/zap" | ||
|
||
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/opampsupervisor/supervisor" | ||
) | ||
|
||
func main() { | ||
configFlag := flag.String("config", "", "Path to a supervisor configuration file") | ||
flag.Parse() | ||
|
||
logger, _ := zap.NewDevelopment() | ||
|
||
supervisor, err := supervisor.NewSupervisor(logger, *configFlag) | ||
if err != nil { | ||
logger.Error(err.Error()) | ||
os.Exit(-1) | ||
return | ||
} | ||
|
||
interrupt := make(chan os.Signal, 1) | ||
signal.Notify(interrupt, os.Interrupt) | ||
<-interrupt | ||
supervisor.Shutdown() | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are any of these teams appropriate code owners? https://github.com/orgs/open-telemetry/teams?query=opamp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I would call out opamp-go-approvers as the best candidate since the Supervisor will be a reference implementation of a client using the OpAMP Go client, but realistically the two are distinct.
@open-telemetry/opamp-go-approvers would you like to be code owners for this?