Skip to content

Commit 8e72d7a

Browse files
authored
Document more explicitly the dictionary zero element requirement. (#711)
Right now we have a comment to the dictionary proto and a comment to the string_table field. This requirement is important enough I think that it's worth documenting it more explicitly, especially the part that even if there are no references to the particular dictionary, the zero index element must still be present.
1 parent d1315d7 commit 8e72d7a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

opentelemetry/proto/profiles/v1development/profiles.proto

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,28 @@ option go_package = "go.opentelemetry.io/proto/otlp/profiles/v1development";
106106
message ProfilesDictionary {
107107
// Mappings from address ranges to the image/binary/library mapped
108108
// into that address range referenced by locations via Location.mapping_index.
109+
//
110+
// mapping_table[0] must always be zero value (Mapping{}) and present.
109111
repeated Mapping mapping_table = 1;
110112

111113
// Locations referenced by samples via Stack.location_indices.
114+
//
115+
// location_table[0] must always be zero value (Location{}) and present.
112116
repeated Location location_table = 2;
113117

114118
// Functions referenced by locations via Line.function_index.
119+
//
120+
// function_table[0] must always be zero value (Function{}) and present.
115121
repeated Function function_table = 3;
116122

117123
// Links referenced by samples via Sample.link_index.
124+
//
125+
// link_table[0] must always be zero value (Link{}) and present.
118126
repeated Link link_table = 4;
119127

120128
// A common table for strings referenced by various messages.
121-
// string_table[0] must always be "".
129+
//
130+
// string_table[0] must always be "" and present.
122131
repeated string string_table = 5;
123132

124133
// A common table for attributes referenced by various messages.
@@ -139,9 +148,13 @@ message ProfilesDictionary {
139148
// These restrictions can change in a minor release.
140149
// The restrictions take origin from the OpenTelemetry specification:
141150
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
151+
//
152+
// attribute_table[0] must always be zero value (KeyValueAndUnit{}) and present.
142153
repeated KeyValueAndUnit attribute_table = 6;
143154

144155
// Stacks referenced by samples via Sample.stack_index.
156+
//
157+
// stack_table[0] must always be zero value (Stack{}) and present.
145158
repeated Stack stack_table = 7;
146159
}
147160

0 commit comments

Comments
 (0)