@@ -99,7 +99,7 @@ message ProfilesDictionary {
9999 // so that _index fields can use 0 to indicate null/unset.
100100 repeated Mapping mapping_table = 1 ;
101101
102- // Locations referenced by samples via Profile .location_indices.
102+ // Locations referenced by samples via Stack .location_indices.
103103 repeated Location location_table = 2 ;
104104
105105 // Functions referenced by locations via Line.function_index.
@@ -119,6 +119,9 @@ message ProfilesDictionary {
119119
120120 // Represents a mapping between Attribute Keys and Units.
121121 repeated AttributeUnit attribute_units = 7 ;
122+
123+ // Stacks referenced by samples via Sample.stack_index.
124+ repeated Stack stack_table = 8 ;
122125}
123126
124127// ProfilesData represents the profiles data that can be stored in persistent storage,
@@ -201,18 +204,19 @@ message ScopeProfiles {
201204// information present to determine the original sampled values.
202205//
203206// - The profile is represented as a set of samples, where each sample
204- // references a sequence of locations, and where each location belongs
207+ // references a stack trace which is a list of locations, each belonging
205208// to a mapping.
206- // - There is a N->1 relationship from sample.location_id entries to
207- // locations. For every sample.location_id entry there must be a
209+ // - There is a N->1 relationship from Stack.location_indices entries to
210+ // locations. For every Stack.location_indices entry there must be a
208211// unique Location with that index.
209212// - There is an optional N->1 relationship from locations to
210213// mappings. For every nonzero Location.mapping_id there must be a
211214// unique Mapping with that index.
212215
213- // Represents a complete profile, including sample types, samples,
214- // mappings to binaries, locations, functions, string table, and additional metadata.
215- // It modifies and annotates pprof Profile with OpenTelemetry specific fields.
216+ // Represents a complete profile, including sample types, samples, mappings to
217+ // binaries, stacks, locations, functions, string table, and additional
218+ // metadata. It modifies and annotates pprof Profile with OpenTelemetry
219+ // specific fields.
216220//
217221// Note that whilst fields in this message retain the name and field id from pprof in most cases
218222// for ease of understanding data migration, it is not intended that pprof:Profile and
@@ -227,51 +231,48 @@ message Profile {
227231 // The set of samples recorded in this profile.
228232 repeated Sample sample = 2 ;
229233
230- // References to locations in ProfilesDictionary.location_table.
231- repeated int32 location_indices = 3 ;
232-
233- // The following fields 4-14 are informational, do not affect
234+ // The following fields 3-13 are informational, do not affect
234235 // interpretation of results.
235236
236237 // Time of collection (UTC) represented as nanoseconds past the epoch.
237- int64 time_nanos = 4 ;
238+ int64 time_nanos = 3 ;
238239 // Duration of the profile, if a duration makes sense.
239- int64 duration_nanos = 5 ;
240+ int64 duration_nanos = 4 ;
240241 // The kind of events between sampled occurrences.
241242 // e.g [ "cpu","cycles" ] or [ "heap","bytes" ]
242- ValueType period_type = 6 ;
243+ ValueType period_type = 5 ;
243244 // The number of events between sampled occurrences.
244- int64 period = 7 ;
245+ int64 period = 6 ;
245246 // Free-form text associated with the profile. The text is displayed as is
246247 // to the user by the tools that read profiles (e.g. by pprof). This field
247248 // should not be used to store any machine-readable information, it is only
248249 // for human-friendly content. The profile must stay functional if this field
249250 // is cleaned.
250- repeated int32 comment_strindices = 8 ; // Indices into ProfilesDictionary.string_table.
251+ repeated int32 comment_strindices = 7 ; // Indices into ProfilesDictionary.string_table.
251252
252253 // A globally unique identifier for a profile. The ID is a 16-byte array. An ID with
253254 // all zeroes is considered invalid. It may be used for deduplication and signal
254255 // correlation purposes. It is acceptable to treat two profiles with different values
255256 // in this field as not equal, even if they represented the same object at an earlier
256257 // time.
257258 // This field is optional; an ID may be assigned to an ID-less profile in a later step.
258- bytes profile_id = 9 ;
259+ bytes profile_id = 8 ;
259260
260261 // dropped_attributes_count is the number of attributes that were discarded. Attributes
261262 // can be discarded because their keys are too long or because there are too many
262263 // attributes. If this value is 0, then no attributes were dropped.
263- uint32 dropped_attributes_count = 10 ;
264+ uint32 dropped_attributes_count = 9 ;
264265
265266 // Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present]
266- string original_payload_format = 11 ;
267+ string original_payload_format = 10 ;
267268
268269 // Original payload can be stored in this field. This can be useful for users who want to get the original payload.
269270 // Formats such as JFR are highly extensible and can contain more information than what is defined in this spec.
270271 // Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload.
271272 // If the original payload is in pprof format, it SHOULD not be included in this field.
272273 // The field is optional, however if it is present then equivalent converted data should be populated in other fields
273274 // of this message as far as is practicable.
274- bytes original_payload = 12 ;
275+ bytes original_payload = 11 ;
275276
276277 // References to attributes in attribute_table. [optional]
277278 // It is a collection of key/value pairs. Note, global attributes
@@ -286,7 +287,7 @@ message Profile {
286287 // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute
287288 // Attribute keys MUST be unique (it is not allowed to have more than one
288289 // attribute with the same key).
289- repeated int32 attribute_indices = 13 ;
290+ repeated int32 attribute_indices = 12 ;
290291}
291292
292293// Represents a mapping between Attribute Keys and Units.
@@ -407,23 +408,20 @@ message ValueType {
407408// values: [2, 2, 3, 3]
408409// timestamps_unix_nano: [1, 2, 3, 4]
409410message Sample {
410- // locations_start_index along with locations_length refers to to a slice of locations in Profile.location_indices.
411- int32 locations_start_index = 1 ;
412- // locations_length along with locations_start_index refers to a slice of locations in Profile.location_indices.
413- // Supersedes location_index.
414- int32 locations_length = 2 ;
411+ // Reference to stack in ProfilesDictionary.stack_table.
412+ int32 stack_index = 1 ;
415413 // The type and unit of each value is defined by Profile.sample_type.
416- repeated int64 values = 3 ;
414+ repeated int64 values = 2 ;
417415 // References to attributes in ProfilesDictionary.attribute_table. [optional]
418- repeated int32 attribute_indices = 4 ;
416+ repeated int32 attribute_indices = 3 ;
419417
420418 // Reference to link in ProfilesDictionary.link_table. [optional]
421419 // It can be unset / set to 0 if no link exists, as link_table[0] is always a 'null' default value.
422- int32 link_index = 5 ;
420+ int32 link_index = 4 ;
423421
424422 // Timestamps associated with Sample represented in nanoseconds. These
425423 // timestamps should fall within the Profile's time range.
426- repeated uint64 timestamps_unix_nano = 6 ;
424+ repeated uint64 timestamps_unix_nano = 5 ;
427425}
428426
429427// Describes the mapping of a binary in memory, including its address range,
@@ -448,6 +446,13 @@ message Mapping {
448446 bool has_inline_frames = 9 ;
449447}
450448
449+ // A Stack represents a stack trace as a list of locations. The first location
450+ // is the leaf frame.
451+ message Stack {
452+ // References to locations in ProfilesDictionary.location_table.
453+ repeated int32 location_indices = 1 ;
454+ }
455+
451456// Describes function and line table debug information.
452457message Location {
453458 // Reference to mapping in ProfilesDictionary.mapping_table.
0 commit comments