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

Set instance_uid by Server on conflict or request for generation #63

Merged
merged 4 commits into from
Mar 22, 2022
Merged
Changes from 1 commit
Commits
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
30 changes: 22 additions & 8 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ ServerToAgent Protobuf messages:


Typically a single Server accepts WebSocket connections from many agents. Agents
are identified by self-assigned globally unique instance identifiers (or
instance_uid for short). The instance_uid is recorded in each message sent from
the Agent to the Server and from the Server to the Agent.
are identified by self-assigned or server-assigned globally unique instance
identifiers (or instance_uid for short). The instance_uid is recorded in each
message sent from the Agent to the Server and from the Server to the Agent.

The default URL path for the initial WebSocket's HTTP connection is /v1/opamp.
The URL path MAY be configurable on the Agent and on the Server.
Expand Down Expand Up @@ -175,6 +175,9 @@ created by other Agents. The instance_uid SHOULD remain unchanged for the
lifetime of the agent process. The recommended format for the instance_uid is
[ULID](https://github.com/ulid/spec).

In case the Agent wants to use an identifier generated by the Server, the field
MAY be unset.

#### status_report

The status of the Agent. MUST be set in the first AgentToServer message that the
Expand Down Expand Up @@ -254,11 +257,19 @@ message ServerToAgent {

#### instance_uid

The Agent instance identifier. MUST match the instance_uid field previously
received in the AgentToServer message. When communication with multiple Agents
is multiplexed into one WebSocket connection (for example when a terminating
proxy is used) the instance_uid field allows to distinguish which Agent the
ServerToAgent message is addressed to.
The Agent instance identifier.

If UpdateInstanceUid flag is set then Agent MUST update its instance_uid to
the provided value (e.g. either because a conflict was detected or an empty
instance_uid was sent previously to the Server, indicating a request for
generating new identifier).

If UpdateInstanceUid flag is not set, the value MUST match the instance_uid
field previously received in the AgentToServer message.

When communication with multiple Agentsis multiplexed into one WebSocket
connection (for example when a terminating proxy is used) the instance_uid field
allows to distinguish which Agent the ServerToAgent message is addressed to.

#### error_response

Expand Down Expand Up @@ -318,6 +329,9 @@ enum Flags {
// set if the Agent indicated it cannot report addon status by setting
// the ReportsAddonStatus bit to 0 in StatusReport.capabilities field.
ReportAddonStatus = 0x00000002;

// The server requests the agent to change its instance_uid to the provided value.
UpdateInstanceUid = 0x00000003;
pmm-sumo marked this conversation as resolved.
Show resolved Hide resolved
}
```

Expand Down