Skip to content

Commit f7676e8

Browse files
authored
Move the profiles lookup tables into a new Dictionary message (#650)
1 parent c7b5bd3 commit f7676e8

File tree

2 files changed

+52
-42
lines changed

2 files changed

+52
-42
lines changed

opentelemetry/proto/collector/profiles/v1development/profiles_service.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ message ExportProfilesServiceRequest {
3737
// data from multiple origins typically batch the data before forwarding further and
3838
// in that case this array will contain multiple elements.
3939
repeated opentelemetry.proto.profiles.v1development.ResourceProfiles resource_profiles = 1;
40+
41+
// The reference table containing all data shared by profiles across the message being sent.
42+
opentelemetry.proto.profiles.v1development.ProfilesDictionary dictionary = 2;
4043
}
4144

4245
message ExportProfilesServiceResponse {

opentelemetry/proto/profiles/v1development/profiles.proto

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ option go_package = "go.opentelemetry.io/proto/otlp/profiles/v1development";
4343

4444
// Relationships Diagram
4545
//
46-
// ┌──────────────────┐ LEGEND
47-
// │ ProfilesData │
48-
// └──────────────────┘ ─────▶ embedded
49-
// │
50-
// │ 1-n ─────▷ referenced by index
51-
// ▼
52-
// ┌──────────────────┐
53-
// │ ResourceProfiles │
54-
// └──────────────────┘
46+
// ┌──────────────────┐ LEGEND
47+
// │ ProfilesData │ ─────┐
48+
// └──────────────────┘ ─────▶ embedded
49+
// │
50+
// │ 1-n ─────▷ referenced by index
51+
// ▼
52+
// ┌──────────────────┐ ┌────────────────────┐
53+
// │ ResourceProfiles │ │ ProfilesDictionary │
54+
// └──────────────────┘ └────────────────────┘
5555
// │
5656
// │ 1-n
5757
// ▼
@@ -90,6 +90,33 @@ option go_package = "go.opentelemetry.io/proto/otlp/profiles/v1development";
9090
// └──────────────────┘
9191
//
9292

93+
// ProfilesDictionary represents the profiles data shared across the
94+
// entire message being sent.
95+
message ProfilesDictionary {
96+
// Mappings from address ranges to the image/binary/library mapped
97+
// into that address range referenced by locations via Location.mapping_index.
98+
repeated Mapping mapping_table = 1;
99+
100+
// Locations referenced by samples via Profile.location_indices.
101+
repeated Location location_table = 2;
102+
103+
// Functions referenced by locations via Line.function_index.
104+
repeated Function function_table = 3;
105+
106+
// Links referenced by samples via Sample.link_index.
107+
repeated Link link_table = 4;
108+
109+
// A common table for strings referenced by various messages.
110+
// string_table[0] must always be "".
111+
repeated string string_table = 5;
112+
113+
// A common table for attributes referenced by various messages.
114+
repeated opentelemetry.proto.common.v1.KeyValue attribute_table = 6;
115+
116+
// Represents a mapping between Attribute Keys and Units.
117+
repeated AttributeUnit attribute_units = 7;
118+
}
119+
93120
// ProfilesData represents the profiles data that can be stored in persistent storage,
94121
// OR can be embedded by other protocols that transfer OTLP profiles data but do not
95122
// implement the OTLP protocol.
@@ -110,28 +137,8 @@ message ProfilesData {
110137
// Resource.attributes and semantic conventions.
111138
repeated ResourceProfiles resource_profiles = 1;
112139

113-
// Mappings from address ranges to the image/binary/library mapped
114-
// into that address range referenced by locations via Location.mapping_index.
115-
repeated Mapping mapping_table = 2;
116-
117-
// Locations referenced by samples via Profile.location_indices.
118-
repeated Location location_table = 3;
119-
120-
// Functions referenced by locations via Line.function_index.
121-
repeated Function function_table = 4;
122-
123-
// Links referenced by samples via Sample.link_index.
124-
repeated Link link_table = 5;
125-
126-
// A common table for strings referenced by various messages.
127-
// string_table[0] must always be "".
128-
repeated string string_table = 6;
129-
130-
// A common table for attributes referenced by various messages.
131-
repeated opentelemetry.proto.common.v1.KeyValue attribute_table = 7;
132-
133-
// Represents a mapping between Attribute Keys and Units.
134-
repeated AttributeUnit attribute_units = 8;
140+
// One instance of ProfilesDictionary
141+
ProfilesDictionary dictionary = 2;
135142
}
136143

137144

@@ -217,7 +224,7 @@ message Profile {
217224
// The set of samples recorded in this profile.
218225
repeated Sample sample = 2;
219226

220-
// References to locations in ProfilesData.location_table.
227+
// References to locations in ProfilesDictionary.location_table.
221228
repeated int32 location_indices = 3;
222229

223230
// The following fields 4-14 are informational, do not affect
@@ -237,7 +244,7 @@ message Profile {
237244
// should not be used to store any machine-readable information, it is only
238245
// for human-friendly content. The profile must stay functional if this field
239246
// is cleaned.
240-
repeated int32 comment_strindices = 8; // Indices into ProfilesData.string_table.
247+
repeated int32 comment_strindices = 8; // Indices into ProfilesDictionary.string_table.
241248
// Index into the sample_type array to the default sample type.
242249
int32 default_sample_type_index = 9;
243250

@@ -368,8 +375,8 @@ enum AggregationTemporality {
368375

369376
// ValueType describes the type and units of a value, with an optional aggregation temporality.
370377
message ValueType {
371-
int32 type_strindex = 1; // Index into ProfilesData.string_table.
372-
int32 unit_strindex = 2; // Index into ProfilesData.string_table.
378+
int32 type_strindex = 1; // Index into ProfilesDictionary.string_table.
379+
int32 unit_strindex = 2; // Index into ProfilesDictionary.string_table.
373380

374381
AggregationTemporality aggregation_temporality = 3;
375382
}
@@ -391,10 +398,10 @@ message Sample {
391398
// result has a list of values that is the element-wise sum of the
392399
// lists of the originals.
393400
repeated int64 value = 3;
394-
// References to attributes in ProfilesData.attribute_table. [optional]
401+
// References to attributes in ProfilesDictionary.attribute_table. [optional]
395402
repeated int32 attribute_indices = 4;
396403

397-
// Reference to link in ProfilesData.link_table. [optional]
404+
// Reference to link in ProfilesDictionary.link_table. [optional]
398405
optional int32 link_index = 5;
399406

400407
// Timestamps associated with Sample represented in nanoseconds. These timestamps are expected
@@ -414,8 +421,8 @@ message Mapping {
414421
// The object this entry is loaded from. This can be a filename on
415422
// disk for the main binary and shared libraries, or virtual
416423
// abstractions like "[vdso]".
417-
int32 filename_strindex = 4; // Index into ProfilesData.string_table.
418-
// References to attributes in ProfilesData.attribute_table. [optional]
424+
int32 filename_strindex = 4; // Index into ProfilesDictionary.string_table.
425+
// References to attributes in ProfilesDictionary.attribute_table. [optional]
419426
repeated int32 attribute_indices = 5;
420427
// The following fields indicate the resolution of symbolic info.
421428
bool has_functions = 6;
@@ -426,7 +433,7 @@ message Mapping {
426433

427434
// Describes function and line table debug information.
428435
message Location {
429-
// Reference to mapping in ProfilesData.mapping_table.
436+
// Reference to mapping in ProfilesDictionary.mapping_table.
430437
// It can be unset if the mapping is unknown or not applicable for
431438
// this profile type.
432439
optional int32 mapping_index = 1;
@@ -451,13 +458,13 @@ message Location {
451458
// profile changes.
452459
bool is_folded = 4;
453460

454-
// References to attributes in ProfilesData.attribute_table. [optional]
461+
// References to attributes in ProfilesDictionary.attribute_table. [optional]
455462
repeated int32 attribute_indices = 5;
456463
}
457464

458465
// Details a specific line in a source code, linked to a function.
459466
message Line {
460-
// Reference to function in ProfilesData.function_table.
467+
// Reference to function in ProfilesDictionary.function_table.
461468
int32 function_index = 1;
462469
// Line number in source code. 0 means unset.
463470
int64 line = 2;

0 commit comments

Comments
 (0)