Skip to content

Commit

Permalink
Require that instance_uid is ULID instead of only recommending it (#116)
Browse files Browse the repository at this point in the history
Resolves #113

This PR changes ULID to be a `MUST` in order to:
- Avoid mistakes when the Agent chooses too short instance id and causes collisions.
- Make the Server's life a bit easier since will know it is always a 128 bits of data and can store in places where UUIDs can be stored (e.g. Postgres has a data type UUID).
  • Loading branch information
tigrannajaryan authored Jul 28, 2022
1 parent cec6d2e commit bbabcbe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,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 recommended format for the instance_uid is
[ULID](https://github.com/ulid/spec).
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.

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 @@ -660,7 +661,9 @@ enum ServerCapabilities {

Properties related to identification of the Agent, which can be overriden 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.
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.

```protobuf
message AgentIdentification {
Expand Down

0 comments on commit bbabcbe

Please sign in to comment.