Skip to content

profiles: make profile_id optional #665

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions opentelemetry/proto/profiles/v1development/profiles.proto
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,11 @@ message Profile {
int32 default_sample_type_index = 9;

// A globally unique identifier for a profile. The ID is a 16-byte array. An ID with
// all zeroes is considered invalid.
//
// This field is required.
// all zeroes is considered invalid. It may be used for deduplication and signal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the ID is a 16-byte array, and is unset, then all bytes are set to zero - is a profile ID unset therefore invalid per this comment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unset will look like "field not set" (e.g. for Python message.HasField("profile_id") == false) or an empty byte array depending on the Protobuf implementation. But in both cases, unset won't look like a 16-byte array of zeros.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea behind stating that An ID with all zeroes is considered invalid is just to provide a null value that the community can use in implementations when a well-formed value must be set for practical reasons.

// correlation purposes. It is acceptable to treat two profiles with different values
// in this field as not equal, even if they represented the same object at an earlier
// time.
// This field is optional; an ID may be assigned to an ID-less profile in a later step.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What value is it set to if unset and optional?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was some discussion in #652 about this, the idea is that if a profile does not have an ID it may receive one for deduplication purposes later, e.g. in the collector. The value would be a real valid identifier, including 16 zeros if that makes sense.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the proto file comment says 16 zeros is invalid. I cannot reconcile it with your statement above.

Copy link
Author

@fandreuz fandreuz Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that's a bit unclear, let me rephrase.

The value would be a real valid identifier, including 16 zeros if that makes sense.

The receiver of an id-less profile (i.e. profile_id absent) is allowed to assign an arbitrary value to profile_id, including the null value (16 zeros).

I'm not sure whether the semantic difference between unset and 16 zeros is part of the spec though. I'm just guessing.

bytes profile_id = 10;

// dropped_attributes_count is the number of attributes that were discarded. Attributes
Expand Down
Loading