Skip to content

Commit 793e43e

Browse files
authored
Renovations to experimental profiling schema. (#596)
- remove Profile keep_frames and drop_frames due to unclear semantics and use cases - make Sample.link_index and Location.mapping_index optional, consistent with documented intention - remove deprecated fields Sample.location_index, Mapping.id, Location.id, Function.id - renumber fields for improved redability
1 parent d77c317 commit 793e43e

1 file changed

Lines changed: 41 additions & 58 deletions

File tree

opentelemetry/proto/profiles/v1development/profiles.proto

Lines changed: 41 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -198,53 +198,47 @@ message Profile {
198198
// Locations referenced by samples via location_indices.
199199
repeated Location location_table = 4;
200200
// Array of locations referenced by samples.
201-
repeated int32 location_indices = 15;
201+
repeated int32 location_indices = 5;
202202
// Functions referenced by locations.
203-
repeated Function function_table = 5;
203+
repeated Function function_table = 6;
204204
// Lookup table for attributes.
205-
repeated opentelemetry.proto.common.v1.KeyValue attribute_table = 16;
205+
repeated opentelemetry.proto.common.v1.KeyValue attribute_table = 7;
206206
// Represents a mapping between Attribute Keys and Units.
207-
repeated AttributeUnit attribute_units = 17;
207+
repeated AttributeUnit attribute_units = 8;
208208
// Lookup table for links.
209-
repeated Link link_table = 18;
209+
repeated Link link_table = 9;
210210
// A common table for strings referenced by various messages.
211211
// string_table[0] must always be "".
212-
repeated string string_table = 6;
213-
// frames with Function.function_name fully matching the following
214-
// regexp will be dropped from the samples, along with their successors.
215-
int32 drop_frames_strindex = 7; // Index into string table.
216-
// frames with Function.function_name fully matching the following
217-
// regexp will be kept, even if it matches drop_frames.
218-
int32 keep_frames_strindex = 8; // Index into string table.
212+
repeated string string_table = 10;
219213

220214
// The following fields 9-14 are informational, do not affect
221215
// interpretation of results.
222216

223217
// Time of collection (UTC) represented as nanoseconds past the epoch.
224-
int64 time_nanos = 9;
218+
int64 time_nanos = 11;
225219
// Duration of the profile, if a duration makes sense.
226-
int64 duration_nanos = 10;
220+
int64 duration_nanos = 12;
227221
// The kind of events between sampled occurrences.
228222
// e.g [ "cpu","cycles" ] or [ "heap","bytes" ]
229-
ValueType period_type = 11;
223+
ValueType period_type = 13;
230224
// The number of events between sampled occurrences.
231-
int64 period = 12;
225+
int64 period = 14;
232226
// Free-form text associated with the profile. The text is displayed as is
233227
// to the user by the tools that read profiles (e.g. by pprof). This field
234228
// should not be used to store any machine-readable information, it is only
235229
// for human-friendly content. The profile must stay functional if this field
236230
// is cleaned.
237-
repeated int32 comment_strindices = 13; // Indices into string table.
231+
repeated int32 comment_strindices = 15; // Indices into string table.
238232
// Index into the string table of the type of the preferred sample
239233
// value. If unset, clients should default to the last sample value.
240-
int32 default_sample_type_strindex = 14;
234+
int32 default_sample_type_strindex = 16;
241235

242236

243237
// A globally unique identifier for a profile. The ID is a 16-byte array. An ID with
244238
// all zeroes is considered invalid.
245239
//
246240
// This field is required.
247-
bytes profile_id = 19;
241+
bytes profile_id = 17;
248242

249243
// attributes is a collection of key/value pairs. Note, global attributes
250244
// like server name can be set using the resource API. Examples of attributes:
@@ -258,23 +252,23 @@ message Profile {
258252
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute
259253
// Attribute keys MUST be unique (it is not allowed to have more than one
260254
// attribute with the same key).
261-
repeated opentelemetry.proto.common.v1.KeyValue attributes = 20;
255+
repeated opentelemetry.proto.common.v1.KeyValue attributes = 18;
262256

263257
// dropped_attributes_count is the number of attributes that were discarded. Attributes
264258
// can be discarded because their keys are too long or because there are too many
265259
// attributes. If this value is 0, then no attributes were dropped.
266-
uint32 dropped_attributes_count = 21;
260+
uint32 dropped_attributes_count = 19;
267261

268262
// Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present]
269-
string original_payload_format = 22;
263+
string original_payload_format = 20;
270264

271265
// Original payload can be stored in this field. This can be useful for users who want to get the original payload.
272266
// Formats such as JFR are highly extensible and can contain more information than what is defined in this spec.
273267
// Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload.
274268
// If the original payload is in pprof format, it SHOULD not be included in this field.
275269
// The field is optional, however if it is present then equivalent converted data should be populated in other fields
276270
// of this message as far as is practicable.
277-
bytes original_payload = 23;
271+
bytes original_payload = 21;
278272
}
279273

280274
// Represents a mapping between Attribute Keys and Units.
@@ -377,31 +371,27 @@ message ValueType {
377371
// augmented with auxiliary information like the thread-id, some
378372
// indicator of a higher level request being handled etc.
379373
message Sample {
380-
// References to locations in Profile.location_table.
381-
// The leaf is at location_index[0]. [deprecated, superseded by locations_start_index / locations_length]
382-
repeated int32 location_index = 1;
383374
// locations_start_index along with locations_length refers to to a slice of locations in Profile.location_indices.
384-
// Supersedes location_index.
385-
int32 locations_start_index = 7;
375+
int32 locations_start_index = 1;
386376
// locations_length along with locations_start_index refers to a slice of locations in Profile.location_indices.
387377
// Supersedes location_index.
388-
int32 locations_length = 8;
378+
int32 locations_length = 2;
389379
// The type and unit of each value is defined by the corresponding
390380
// entry in Profile.sample_type. All samples must have the same
391381
// number of values, the same as the length of Profile.sample_type.
392382
// When aggregating multiple samples into a single sample, the
393383
// result has a list of values that is the element-wise sum of the
394384
// lists of the originals.
395-
repeated int64 value = 2;
385+
repeated int64 value = 3;
396386
// References to attributes in Profile.attribute_table. [optional]
397-
repeated int32 attribute_indices = 10;
387+
repeated int32 attribute_indices = 4;
398388

399389
// Reference to link in Profile.link_table. [optional]
400-
int32 link_index = 12;
390+
optional int32 link_index = 5;
401391

402392
// Timestamps associated with Sample represented in nanoseconds. These timestamps are expected
403393
// to fall within the Profile's time range. [optional]
404-
repeated uint64 timestamps_unix_nano = 13;
394+
repeated uint64 timestamps_unix_nano = 6;
405395
}
406396

407397
// Provides additional context for a sample,
@@ -426,59 +416,54 @@ message Label {
426416
// Describes the mapping of a binary in memory, including its address range,
427417
// file offset, and metadata like build ID
428418
message Mapping {
429-
// Unique nonzero id for the mapping. [deprecated]
430-
uint64 id = 1;
431419
// Address at which the binary (or DLL) is loaded into memory.
432-
uint64 memory_start = 2;
420+
uint64 memory_start = 1;
433421
// The limit of the address range occupied by this mapping.
434-
uint64 memory_limit = 3;
422+
uint64 memory_limit = 2;
435423
// Offset in the binary that corresponds to the first mapped address.
436-
uint64 file_offset = 4;
424+
uint64 file_offset = 3;
437425
// The object this entry is loaded from. This can be a filename on
438426
// disk for the main binary and shared libraries, or virtual
439427
// abstractions like "[vdso]".
440-
int32 filename_strindex = 5; // Index into string table
428+
int32 filename_strindex = 4; // Index into string table
441429
// References to attributes in Profile.attribute_table. [optional]
442-
repeated int32 attribute_indices = 12;
430+
repeated int32 attribute_indices = 5;
443431
// The following fields indicate the resolution of symbolic info.
444-
bool has_functions = 7;
445-
bool has_filenames = 8;
446-
bool has_line_numbers = 9;
447-
bool has_inline_frames = 10;
432+
bool has_functions = 6;
433+
bool has_filenames = 7;
434+
bool has_line_numbers = 8;
435+
bool has_inline_frames = 9;
448436
}
449437

450438
// Describes function and line table debug information.
451439
message Location {
452-
// Unique nonzero id for the location. A profile could use
453-
// instruction addresses or any integer sequence as ids. [deprecated]
454-
uint64 id = 1;
455440
// Reference to mapping in Profile.mapping_table.
456441
// It can be unset if the mapping is unknown or not applicable for
457442
// this profile type.
458-
int32 mapping_index = 2;
443+
optional int32 mapping_index = 1;
459444
// The instruction address for this location, if available. It
460445
// should be within [Mapping.memory_start...Mapping.memory_limit]
461446
// for the corresponding mapping. A non-leaf address may be in the
462447
// middle of a call instruction. It is up to display tools to find
463448
// the beginning of the instruction if necessary.
464-
uint64 address = 3;
449+
uint64 address = 2;
465450
// Multiple line indicates this location has inlined functions,
466451
// where the last entry represents the caller into which the
467452
// preceding entries were inlined.
468453
//
469454
// E.g., if memcpy() is inlined into printf:
470455
// line[0].function_name == "memcpy"
471456
// line[1].function_name == "printf"
472-
repeated Line line = 4;
457+
repeated Line line = 3;
473458
// Provides an indication that multiple symbols map to this location's
474459
// address, for example due to identical code folding by the linker. In that
475460
// case the line information above represents one of the multiple
476461
// symbols. This field must be recomputed when the symbolization state of the
477462
// profile changes.
478-
bool is_folded = 5;
463+
bool is_folded = 4;
479464

480465
// References to attributes in Profile.attribute_table. [optional]
481-
repeated int32 attribute_indices = 7;
466+
repeated int32 attribute_indices = 5;
482467
}
483468

484469
// Details a specific line in a source code, linked to a function.
@@ -494,15 +479,13 @@ message Line {
494479
// Describes a function, including its human-readable name, system name,
495480
// source file, and starting line number in the source.
496481
message Function {
497-
// Unique nonzero id for the function. [deprecated]
498-
uint64 id = 1;
499482
// Name of the function, in human-readable form if available.
500-
int32 name_strindex = 2; // Index into string table
483+
int32 name_strindex = 1; // Index into string table
501484
// Name of the function, as identified by the system.
502485
// For instance, it can be a C++ mangled name.
503-
int32 system_name_strindex = 3; // Index into string table
486+
int32 system_name_strindex = 2; // Index into string table
504487
// Source file containing the function.
505-
int32 filename_strindex = 4; // Index into string table
488+
int32 filename_strindex = 3; // Index into string table
506489
// Line number in source file.
507-
int64 start_line = 5;
490+
int64 start_line = 4;
508491
}

0 commit comments

Comments
 (0)