Skip to content

profiles: dictionary table encoding consistency improvement. #672

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 1 commit into
base: main
Choose a base branch
from

Conversation

jhalliday
Copy link
Contributor

Subsequent to #659 (profiles: avoid 'optional' keyword usage) and in accordance with discussions in the profiling SIG, this PR updates the dictionary message docs to impose a more consistent handling of 'null pointer' semantics in the encoding pattern.

@jhalliday jhalliday requested review from a team as code owners June 13, 2025 10:03
@jhalliday
Copy link
Contributor Author

ref #659 (comment)
@open-telemetry/profiling-maintainers @jsuereth

@@ -93,10 +93,15 @@ option go_package = "go.opentelemetry.io/proto/otlp/profiles/v1development";
// ProfilesDictionary represents the profiles data shared across the
// entire message being sent.
message ProfilesDictionary {

// Note all fields in this message MUST have a zero value encoded as the first element.
Copy link
Member

Choose a reason for hiding this comment

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

We don't have index lookups for attribute_units and a zero value encoded as the first element isn't needed for that field, so this is a little confusing as-is. Maybe we can say "all fields except attribute_units".

Comment on lines +98 to +101
// This allows for _index fields pointing into the dictionary to use a 0 pointer value to indicate 'null' / 'not set'
// without requiring 'optional' encoding, which would be less compact.
// Unless otherwise defined, a 'zero value' message value is one with all default field values,
// so as to minimize wire encoded size.
Copy link
Member

Choose a reason for hiding this comment

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

I think we can trim this text down a bit:

Suggested change
// This allows for _index fields pointing into the dictionary to use a 0 pointer value to indicate 'null' / 'not set'
// without requiring 'optional' encoding, which would be less compact.
// Unless otherwise defined, a 'zero value' message value is one with all default field values,
// so as to minimize wire encoded size.
// This allows for _index fields pointing into the dictionary to use a 0 pointer value
// to indicate 'null' / 'not set'. Unless otherwise defined, a 'zero value' message value is one with all default field
// values, so as to minimize wire encoded size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants