Skip to content

Commit

Permalink
Add SDK data classes for experimental profiling signal type.
Browse files Browse the repository at this point in the history
Changes addressing code review comments.
  • Loading branch information
jhalliday committed Apr 29, 2024
1 parent ae94404 commit f84df98
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
/**
* Specifies the method of aggregating metric values.
*
* <p>TODO: This is intentionally not the same as metrics/AggregationTemporality. For profiles.proto
* 'v1experimental' version, this class is considered distinct from the pre-exiting
* AggregationTemporality in metrics.proto. As the profiles.proto stabilises, they may be refactored
* into a version in common.proto. Meanwhile the Java class structure reflects the .proto structure
* in making distinct entities.
*
* <p>refs for refactoring discussion:
*
* @see
* "https://github.com/open-telemetry/opentelemetry-proto/blob/v1.3.0/opentelemetry/proto/metrics/v1/metrics.proto#L261"
* @see
* "https://github.com/open-telemetry/opentelemetry-proto/blob/v1.3.0/opentelemetry/proto/profiles/v1experimental/pprofextended.proto#L147"
* @see "https://github.com/open-telemetry/opentelemetry-proto/issues/547"
* @see "https://github.com/open-telemetry/opentelemetry-proto/pull/534#discussion_r1552403726"
* @see "profiles.proto::AggregationTemporality"
*/
public enum AggregationTemporality {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public interface ProfileContainerData {
* UTC on 1 January 1970. This field is semantically required and it is expected that end_time >=
* start_time.
*/
long getStartTimeUnixNano();
long getStartEpochNanos();

/**
* Returns the end time of the profile. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC
* on 1 January 1970. This field is semantically required and it is expected that end_time >=
* start_time.
*/
long getEndTimeUnixNano();
long getEndEpochNanos();

/**
* Returns profile-wide attributes. Attribute keys MUST be unique (it is not allowed to have more
Expand All @@ -57,11 +57,12 @@ public interface ProfileContainerData {
Attributes getAttributes();

/**
* Returns the number of attributes that were discarded. Attributes can be discarded because their
* keys are too long, or because there are too many attributes. If this value is 0, then no
* attributes were dropped.
* Returns the total number of attributes that were recorded on this profile container.
*
* <p>This number may be larger than the number of attributes that are attached to this profile
* container, if the total number recorded was greater than the configured maximum value.
*/
int getDroppedAttributesCount();
int getTotalAttributeCount();

/**
* Returns the format of the original payload. Common values are defined in semantic conventions.
Expand Down

0 comments on commit f84df98

Please sign in to comment.