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

Replace ULIDs by 16 byte ids and recommend UUID v7 #186

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 5 additions & 4 deletions proto/opamp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ option go_package = "github.com/open-telemetry/opamp-go/protobufs";
message AgentToServer {
// Globally unique identifier of the running instance of the Agent. SHOULD remain
// unchanged for the lifetime of the Agent process.
// Recommended format: https://github.com/ulid/spec
string instance_uid = 1;
// MUST be 16 bytes long and SHOULD be generated using the UUID v7 spec.
bytes instance_uid = 1;
tigrannajaryan marked this conversation as resolved.
Show resolved Hide resolved

// The sequence number is incremented by 1 for every AgentToServer sent
// by the Agent. This allows the Server to detect that it missed a message when
Expand Down Expand Up @@ -148,7 +148,7 @@ message CertificateRequest {
message ServerToAgent {
// Agent instance uid. MUST match the instance_uid field in AgentToServer message.
// Used for multiplexing messages from/to multiple agents using one message stream.
string instance_uid = 1;
bytes instance_uid = 1;

// error_response is set if the Server wants to indicate that something went wrong
// during processing of an AgentToServer message. If error_response is set then
Expand Down Expand Up @@ -804,7 +804,8 @@ enum PackageStatusEnum {
message AgentIdentification {
// When new_instance_uid is set, Agent MUST update instance_uid
// to the value provided and use it for all further communication.
string new_instance_uid = 1;
// MUST be 16 bytes long and SHOULD be generated using the UUID v7 spec.
bytes new_instance_uid = 1;
}

/////////////////////////////////////////////////////////////////////////////////////
Expand Down
16 changes: 8 additions & 8 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ document are specified in

```protobuf
message AgentToServer {
string instance_uid = 1;
bytes instance_uid = 1;
uint64 sequence_num = 2;
AgentDescription agent_description = 3;
uint64 capabilities = 4;
Expand All @@ -504,9 +504,9 @@ The instance_uid field is a globally unique identifier of the running instance
of the Agent. The Agent SHOULD self-generate this identifier and make the best
effort to avoid creating an identifier that may conflict with identifiers
created by other Agents. The instance_uid SHOULD remain unchanged for the
lifetime of the Agent process. The instance_uid MUST be a
[ULID](https://github.com/ulid/spec) formatted as a 26 character string in canonical
representation.
lifetime of the Agent process. The instance_uid MUST be
16 bytes long and SHOULD be generated using the
[UUID v7 spec](https://www.ietf.org/archive/id/draft-ietf-uuidrev-rfc4122bis-14.html#name-uuid-version-7).

In case the Agent wants to use an identifier generated by the Server, the field
SHOULD be set with a temporary value and RequestInstanceUid flag MUST be set.
Expand Down Expand Up @@ -704,7 +704,7 @@ The ServerToAgent message has the following structure:

```protobuf
message ServerToAgent {
string instance_uid = 1;
bytes instance_uid = 1;
ServerErrorResponse error_response = 2;
AgentRemoteConfig remote_config = 3;
ConnectionSettingsOffers connection_settings = 4; // Status: [Beta]
Expand Down Expand Up @@ -826,12 +826,12 @@ enum ServerCapabilities {
Properties related to identification of the Agent, which can be overridden by the
Server if needed. When new_instance_uid is set, Agent MUST update instance_uid
to the value provided and use it for all further communication. The new_instance_uid MUST
be a [ULID](https://github.com/ulid/spec) formatted as a 26 character string in canonical
representation.
be 16 bytes long and SHOULD be generated using the
[UUID v7 spec](https://www.ietf.org/archive/id/draft-ietf-uuidrev-rfc4122bis-14.html#name-uuid-version-7).

```protobuf
message AgentIdentification {
string new_instance_uid = 1;
bytes new_instance_uid = 1;
}
```

Expand Down
Loading