Skip to content

Commit 17c60ac

Browse files
committed
Clarify the profile and sample timestamps relationship.
1 parent 1bd04ef commit 17c60ac

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The full list of changes can be found in the compare view for the respective rel
88

99
### Changed
1010

11+
- profiles: clarify the profile and sample timestamps relationship. [#744](https://github.com/open-telemetry/opentelemetry-proto/pull/744)
12+
1113
### Fixed
1214

1315
- logs: `SEVERITY_NUMBER_UNSPECIFIED` can be used as the `severity_number` field is optional. [#736](https://github.com/open-telemetry/opentelemetry-proto/pull/736)

opentelemetry/proto/profiles/v1development/profiles.proto

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,13 @@ message Profile {
284284
// The following fields 3-12 are informational, do not affect
285285
// interpretation of results.
286286

287-
// Time of collection (UTC) represented as nanoseconds past the epoch.
287+
// Time of collection represented as nanoseconds past the epoch.
288288
fixed64 time_unix_nano = 3;
289-
// Duration of the profile, if a duration makes sense.
289+
// Duration of the profile. For instant profiles like live heap snapshot, the
290+
// duration can be zero but it may be preferable to set time_unix_nano to the
291+
// process start time and duration_nano to the relative time when the profile
292+
// was gathered. This ensures Sample.timestamps_unix_nano values such as
293+
// allocation timestamp fall into the profile time range.
290294
uint64 duration_nano = 4;
291295
// The kind of events between sampled occurrences.
292296
// e.g [ "cpu","cycles" ] or [ "heap","bytes" ]
@@ -398,7 +402,9 @@ message Sample {
398402
// The type and unit of each value is defined by Profile.sample_type.
399403
repeated int64 values = 4;
400404
// Timestamps associated with Sample represented in nanoseconds. These
401-
// timestamps should fall within the Profile's time range.
405+
// timestamps should fall within the
406+
// [Profile.time_unix_nano, Profile.time_unix_nano + Profile.duration_nano)
407+
// time range.
402408
repeated fixed64 timestamps_unix_nano = 5;
403409
}
404410

0 commit comments

Comments
 (0)