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

Add plain HTTP transport to OpAMP #70

Merged
merged 2 commits into from
Apr 7, 2022

Conversation

tigrannajaryan
Copy link
Member

Resolves #50

Certain applications may not need the OpAMP's capabilities enabled by WebSocket (ability to push configs from server without Agent's polling) and may prefer to implement a simpler HTTP transport. This is likely the case for short-lived Agents such as for example the ones running in AWS lambda. The HTTP transport is likely simpler to implement on the Server (easier to manage connections) and also removes an additional dependency (a WebSocket library) from the client.

We are also considering implementing OpAMP in OpenTelemetry SDKs, which can result in significantly larger number of OpAMP Agents connecting to the Server, so the Server has to handle a larger number of persistent WebSocket connections, which may pose more burden than necessary for use cases where there are no benefits from having a persistent connection (e.g. the above mentioned short-lived use case).

This changes defines a plain HTTP transport for OpAMP. It is a fairly simple modification of the spec to allow it, with AgentToServer/ServerToAgent messages exchanged via HTTP POST Body.

It is also not very complicated to support both WebSocket and plain HTTP on the same Server and if we want to make it seamless from Agent's perspective we can add an indicator of the desired transport in the initial connection attempt made by the Agent, so that the Server knows whether to upgrade to WebSocket or just reply in plain HTTP. The "Content-Type" request header can be such indicator. We can add this in a follow-up PR.

Here is a draft Go OpAMP server implementation for reference: open-telemetry/opamp-go@main...tigrannajaryan:plain-http-transport

Resolves open-telemetry#50

Certain applications may not need the OpAMP's capabilities enabled by WebSocket (ability to push configs from server without Agent's polling) and may prefer to implement a simpler HTTP transport. This is likely the case for short-lived Agents such as for example the ones running in AWS lambda. The HTTP transport is likely simpler to implement on the Server (easier to manage connections) and also removes an additional dependency (a WebSocket library) from the client.

We are also considering implementing OpAMP in OpenTelemetry SDKs, which can result in significantly larger number of OpAMP Agents connecting to the Server, so the Server has to handle a larger number of persistent WebSocket connections, which may pose more burden than necessary for use cases where there are no benefits from having a persistent connection (e.g. the above mentioned short-lived use case).

This changes defines a plain HTTP transport for OpAMP. It is a fairly simple modification of the spec to allow it, with AgentToServer/ServerToAgent messages exchanged via HTTP POST Body.

It is also not very complicated to support both WebSocket and plain HTTP on the same Server and if we want to make it seamless from Agent's perspective we can add an indicator of the desired transport in the initial connection attempt made by the Agent, so that the Server knows whether to upgrade to WebSocket or just reply in plain HTTP. The "Content-Type" request header can be such indicator. We can add this in a follow-up PR.

Here is a draft Go OpAMP server implementation for reference: open-telemetry/opamp-go@main...tigrannajaryan:plain-http-transport
@anuraggujral
Copy link

In the above PR, it is not clear from the second paragraph that here we are considering OpenTelemetry SDKs as agents, may be very should make it more explicit.

@tigrannajaryan
Copy link
Member Author

@pmm-sumo what do you think about this change?

specification.md Outdated Show resolved Hide resolved
@pmm-sumo
Copy link
Contributor

pmm-sumo commented Apr 1, 2022

@pmm-sumo what do you think about this change?

I think it will be a very useful addition. I think it might be worth running by OpenTelemetry SDK's maintainers, since this is one of the use cases for it

specification.md Outdated Show resolved Hide resolved
@tigrannajaryan tigrannajaryan marked this pull request as ready for review April 5, 2022 17:35
@tigrannajaryan tigrannajaryan requested review from a team and pmm-sumo April 5, 2022 17:35
@tigrannajaryan tigrannajaryan merged commit 334198f into open-telemetry:main Apr 7, 2022
@tigrannajaryan tigrannajaryan deleted the add-plain-http branch April 7, 2022 16:28
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this pull request Apr 7, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this pull request Apr 7, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this pull request Apr 7, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this pull request Apr 7, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this pull request Apr 12, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this pull request Apr 12, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this pull request Apr 12, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
tigrannajaryan added a commit to tigrannajaryan/opamp-go that referenced this pull request Apr 12, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
tigrannajaryan added a commit to open-telemetry/opamp-go that referenced this pull request Apr 13, 2022
This adds plain HTTP request support to OpAMPServer implementation.
Implements spec change: open-telemetry/opamp-spec#70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpAMP over plain HTTP transport
3 participants