Skip to content

Commit

Permalink
Clarify Connection Establishment and Restoring
Browse files Browse the repository at this point in the history
Contributes to open-telemetry#28
  • Loading branch information
tigrannajaryan committed Nov 18, 2021
1 parent c0c991e commit 202b91f
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1932,14 +1932,20 @@ The downloadable file of the package.
<h1 id="connection-management">Connection Management</h1>


<h2 id="establishing-connection">Establishing Connection</h2>
## Establishing Connection


The Agent connects to the Server by establishing an HTTP connection, then
The Agent connects to the Server by establishing an HTTP(S) connection, then
upgrading the connection to WebSocket as defined by WebSocket standard. After
the WebSocket connection is open the Agent MUST send the first
the WebSocket connection is established the Agent MUST send the first
[status report](#status-reporting) and expect a response to it.

If the Agent is unable to establish a WebSocket connection to the Server it
SHOULD retry connection attempts and use exponential backoff strategy with
jitter to avoid overwhelming the Server.

When retrying connection attempts the Agent SHOULD honour any
[throttling](#throttling) responses it receives from the Server.

<h2 id="closing-connection">Closing Connection</h2>


Expand All @@ -1958,6 +1964,14 @@ To close a connection the Server MUST then send a WebSocket
[Close](https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.1) control
frame and follow the procedure defined by WebSocket standard.

## Restoring Connection

If an established WebSocket connection is broken (disconnected) unexpectedly the
Agent SHOULD immediately try to re-connect. If the re-connection fails the Agent
SHOULD continue connection attempts with backoff as described in
[Establishing Connection](#establishing-connection).


<h2 id="duplicate-connections">Duplicate Connections</h2>


Expand Down Expand Up @@ -2044,8 +2058,7 @@ deliver to the Agent and send it as soon as the connection to the Agent is
available.


<h2 id="throttling">Throttling</h2>

## Throttling

When the Server is overloaded and is unstable to process the AgentToServer
message it SHOULD respond with an ServerToAgent message with error_response
Expand Down

0 comments on commit 202b91f

Please sign in to comment.