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 May 7, 2024
1 parent 112796b commit 2fa0060
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
package io.opentelemetry.sdk.profiles.data;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.internal.OtelEncodingUtils;
import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
import io.opentelemetry.sdk.resources.Resource;
import java.nio.ByteBuffer;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;

Expand All @@ -27,11 +29,18 @@ public interface ProfileContainerData {
InstrumentationScopeInfo getInstrumentationScopeInfo();

/**
* Returns a globally unique identifier for a profile. The ID is a 16-byte array. An ID with all
* zeroes is considered invalid. This field is required.
* Returns a globally unique identifier for a profile, as 32 character lowercase hex String. An ID
* with all zeroes is considered invalid. This field is required.
*/
@SuppressWarnings("mutable")
byte[] getProfileId();
String getProfileId();

/**
* Returns a globally unique identifier for a profile, as a 16 bytes array. An ID with all zeroes
* is considered invalid. This field is required.
*/
default byte[] getProfileIdBytes() {
return OtelEncodingUtils.bytesFromBase16(getProfileId(), 32);
}

/**
* Returns the start time of the profile. Value is UNIX Epoch time in nanoseconds since 00:00:00
Expand Down Expand Up @@ -76,9 +85,7 @@ public interface ProfileContainerData {
* should be to not include the original payload. If the original payload is in pprof format, it
* SHOULD not be included in this field.
*/
@SuppressWarnings("mutable")
@Nullable
byte[] getOriginalPayload();
ByteBuffer getOriginalPayload();

/** Returns an extended pprof profile. Required, even when originalPayload is also present. */
ProfileData getProfile();
Expand Down

0 comments on commit 2fa0060

Please sign in to comment.