Skip to content

profiles: avoid 'optional' keyword usage #659

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

Merged
merged 3 commits into from
Jun 12, 2025
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
13 changes: 9 additions & 4 deletions opentelemetry/proto/profiles/v1development/profiles.proto
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ option go_package = "go.opentelemetry.io/proto/otlp/profiles/v1development";
message ProfilesDictionary {
// Mappings from address ranges to the image/binary/library mapped
// into that address range referenced by locations via Location.mapping_index.
// mapping_table[0] must always be set to an invalid default mapping,
// so that _index fields can use 0 to indicate null/unset.
repeated Mapping mapping_table = 1;

// Locations referenced by samples via Profile.location_indices.
Expand All @@ -104,6 +106,8 @@ message ProfilesDictionary {
repeated Function function_table = 3;

// Links referenced by samples via Sample.link_index.
// link_table[0] must always be set to an invalid default link,
// so that _index fields can use 0 to indicate null/unset.
repeated Link link_table = 4;

// A common table for strings referenced by various messages.
Expand Down Expand Up @@ -402,7 +406,8 @@ message Sample {
repeated int32 attribute_indices = 4;

// Reference to link in ProfilesDictionary.link_table. [optional]
optional int32 link_index = 5;
// It can be unset / set to 0 if no link exists, as link_table[0] is always a 'null' default value.
int32 link_index = 5;

// Timestamps associated with Sample represented in nanoseconds. These timestamps are expected
// to fall within the Profile's time range. [optional]
Expand Down Expand Up @@ -434,9 +439,9 @@ message Mapping {
// Describes function and line table debug information.
message Location {
// Reference to mapping in ProfilesDictionary.mapping_table.
// It can be unset if the mapping is unknown or not applicable for
// this profile type.
optional int32 mapping_index = 1;
// It can be unset / set to 0 if the mapping is unknown or not applicable for
// this profile type, as mapping_table[0] is always a 'null' default mapping.
int32 mapping_index = 1;
// The instruction address for this location, if available. It
// should be within [Mapping.memory_start...Mapping.memory_limit]
// for the corresponding mapping. A non-leaf address may be in the
Expand Down
Loading