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

OpAMP Agent Extension #885

Merged
merged 47 commits into from
Jan 23, 2023
Merged

OpAMP Agent Extension #885

merged 47 commits into from
Jan 23, 2023

Conversation

portertech
Copy link
Contributor

@portertech portertech commented Dec 29, 2022

Creating this PR for increased visibility, early feedback, and OpAMP server testing. This pull-request supersedes #855.

This OpAMP agent implementation manages a single local configuration file (e.g. opamp-remote-config.yaml) intended to be consumed by the glob configuration provider. The configuration file directory is configurable via remote_configuration_directory, this directory must match the glob configuration provider pattern used by the collector (e.g. remote_configuration_directory: /etc/otelcol-sumo/conf.d -> --config "glob:/etc/otelcol-sumo/conf.d/*"). Remote configuration updates trigger a collector reload via a SIGHUP signal (to self).

Example OpAMP configuration for testing:

extensions:
  sumologic:
    install_token: ${SUMOLOGIC_INSTALL_TOKEN}
    api_base_url: "https://stag-open-events.sumologic.net"
  opamp:
    instance_uid: 01BX5ZZKBKACTAV9WEVGEMMVRZ
    endpoint: "wss://stag-opamp-events.sumologic.net/v1/opamp"
    remote_configuration_directory: /Users/sporter/Desktop/conf.d
./otelcolbuilder/cmd/otelcol-sumo --config /Users/sporter/Desktop/sumologic.yaml --config "glob:/Users/sporter/Desktop/conf.d/*"

@portertech portertech requested a review from a team as a code owner December 29, 2022 23:02
@github-actions github-actions bot added the go label Dec 29, 2022
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 29, 2022
@portertech portertech mentioned this pull request Dec 29, 2022
@portertech
Copy link
Contributor Author

portertech commented Dec 29, 2022

This extension is currently able to authenticate to our OpAMP server and send a mock effective configuration on request. There is a known race condition in regards to authentication.

2022-12-29T15:19:59.994-0800    info    [email protected]/opamp_agent.go:91     Connected to the OpAMP server   {"kind": "extension", "name": "opamp"}
2022-12-29T15:19:59.995-0800    info    [email protected]/opamp_agent.go:100    OpAMP server requested the effective configuration      {"kind": "extension", "name": "opamp"}

The OpAMP server does not yet reply with a remote configuration to apply. If it were to reply with one, the extension's OpAMP agent would produce a new effective configuration and report it to the server. The effective configuration is not yet applied to the collector itself (soon). This work is in a state where it is useful for testing the OpAMP server development.

sumo-drosiek
sumo-drosiek previously approved these changes Dec 30, 2022
@sumo-drosiek sumo-drosiek dismissed their stale review December 30, 2022 06:19

saw only last commit

@portertech
Copy link
Contributor Author

@sumo-drosiek I'll definitely call upon you for a review once things stabilize 👍

Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@portertech one thing that I thing we need is a README, other than that LGTM (as alpha feature that's disabled by default 😉 )

@@ -0,0 +1,94 @@
# OpAMP Agent Extension
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@perk-sumo Is this sufficient? I used the Sumo extension readme as a base.

@portertech portertech merged commit 1626e3f into main Jan 23, 2023
@portertech portertech deleted the feature/opamp-extension branch January 23, 2023 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation go
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants