-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add exporter data model impl for profiling signal type. (#6498)
- Loading branch information
Showing
13 changed files
with
494 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...rc/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.exporter.otlp.profiles.AttributeUnitData; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Auto value implementation of {@link AttributeUnitData}, which represents a mapping between | ||
* Attribute Keys and Units. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
@Immutable | ||
@AutoValue | ||
public abstract class ImmutableAttributeUnitData implements AttributeUnitData { | ||
|
||
/** | ||
* Returns a new AttributeUnitData mapping the given key to the given unit. | ||
* | ||
* @return a new AttributeUnitData mapping the given key to the given unit. | ||
*/ | ||
public static AttributeUnitData create(long attributeKey, long unitIndex) { | ||
return new AutoValue_ImmutableAttributeUnitData(attributeKey, unitIndex); | ||
} | ||
|
||
ImmutableAttributeUnitData() {} | ||
} |
34 changes: 34 additions & 0 deletions
34
...les/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.exporter.otlp.profiles.FunctionData; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Auto value implementation of {@link FunctionData}, which describes a code function. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
@Immutable | ||
@AutoValue | ||
public abstract class ImmutableFunctionData implements FunctionData { | ||
|
||
/** | ||
* Returns a new FunctionData describing the given function characteristics. | ||
* | ||
* @return a new FunctionData describing the given function characteristics. | ||
*/ | ||
public static FunctionData create( | ||
long nameIndex, long systemNameIndex, long filenameIndex, long startLine) { | ||
return new AutoValue_ImmutableFunctionData( | ||
nameIndex, systemNameIndex, filenameIndex, startLine); | ||
} | ||
|
||
ImmutableFunctionData() {} | ||
} |
32 changes: 32 additions & 0 deletions
32
...ofiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLabelData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.exporter.otlp.profiles.LabelData; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Auto value implementation of {@link LabelData}, which provides additional context for a sample. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
@Immutable | ||
@AutoValue | ||
public abstract class ImmutableLabelData implements LabelData { | ||
|
||
/** | ||
* Returns a new LabelData describing the given context for a sample. | ||
* | ||
* @return a new LabelData describing the given context for a sample. | ||
*/ | ||
public static LabelData create(long keyIndex, long strIndex, long num, long numUnitIndex) { | ||
return new AutoValue_ImmutableLabelData(keyIndex, strIndex, num, numUnitIndex); | ||
} | ||
|
||
ImmutableLabelData() {} | ||
} |
33 changes: 33 additions & 0 deletions
33
...rofiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.exporter.otlp.profiles.LineData; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Auto value implementation of {@link LineData}, which details a specific line in a source code, | ||
* linked to a function. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
@Immutable | ||
@AutoValue | ||
public abstract class ImmutableLineData implements LineData { | ||
|
||
/** | ||
* Returns a new LineData describing the given details a specific line in a source code. | ||
* | ||
* @return a new LineData describing the given details a specific line in a source code. | ||
*/ | ||
public static LineData create(long functionIndex, long line, long column) { | ||
return new AutoValue_ImmutableLineData(functionIndex, line, column); | ||
} | ||
|
||
ImmutableLineData() {} | ||
} |
33 changes: 33 additions & 0 deletions
33
...rofiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLinkData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.exporter.otlp.profiles.LinkData; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Auto value implementation of {@link LinkData}, which represents a connection from a profile | ||
* Sample to a trace Span. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
@Immutable | ||
@AutoValue | ||
public abstract class ImmutableLinkData implements LinkData { | ||
|
||
/** | ||
* Returns a new LinkData representing an association to the given trace span. | ||
* | ||
* @return a new LinkData representing an association to the given trace span. | ||
*/ | ||
public static LinkData create(String traceId, String spanId) { | ||
return new AutoValue_ImmutableLinkData(traceId, spanId); | ||
} | ||
|
||
ImmutableLinkData() {} | ||
} |
42 changes: 42 additions & 0 deletions
42
...les/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.exporter.otlp.profiles.LineData; | ||
import io.opentelemetry.exporter.otlp.profiles.LocationData; | ||
import java.util.List; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Auto value implementation of {@link LocationData}, which describes function and line table debug | ||
* information. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
@Immutable | ||
@AutoValue | ||
public abstract class ImmutableLocationData implements LocationData { | ||
|
||
/** | ||
* Returns a new LocationData describing the given function and line table information. | ||
* | ||
* @return a new LocationData describing the given function and line table information. | ||
*/ | ||
public static LocationData create( | ||
long mappingIndex, | ||
long address, | ||
List<LineData> lines, | ||
boolean folded, | ||
int typeIndex, | ||
List<Long> attributes) { | ||
return new AutoValue_ImmutableLocationData( | ||
mappingIndex, address, lines, folded, typeIndex, attributes); | ||
} | ||
|
||
ImmutableLocationData() {} | ||
} |
58 changes: 58 additions & 0 deletions
58
...iles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.exporter.otlp.profiles.BuildIdKind; | ||
import io.opentelemetry.exporter.otlp.profiles.MappingData; | ||
import java.util.List; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Auto value implementation of {@link MappingData}, which describes the mapping of a binary in | ||
* memory. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
@Immutable | ||
@AutoValue | ||
public abstract class ImmutableMappingData implements MappingData { | ||
|
||
/** | ||
* Returns a new MappingData describing the given mapping of a binary in memory. | ||
* | ||
* @return a new MappingData describing the given mapping of a binary in memory. | ||
*/ | ||
@SuppressWarnings("TooManyParameters") | ||
public static MappingData create( | ||
long memoryStart, | ||
long memoryLimit, | ||
long fileOffset, | ||
long filenameIndex, | ||
long buildIdIndex, | ||
BuildIdKind buildIdKind, | ||
List<Long> attributeIndices, | ||
boolean hasFunctions, | ||
boolean hasFilenames, | ||
boolean hasLineNumbers, | ||
boolean hasInlineFrames) { | ||
return new AutoValue_ImmutableMappingData( | ||
memoryStart, | ||
memoryLimit, | ||
fileOffset, | ||
filenameIndex, | ||
buildIdIndex, | ||
buildIdKind, | ||
attributeIndices, | ||
hasFunctions, | ||
hasFilenames, | ||
hasLineNumbers, | ||
hasInlineFrames); | ||
} | ||
|
||
ImmutableMappingData() {} | ||
} |
63 changes: 63 additions & 0 deletions
63
...main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.internal.data; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.api.common.Attributes; | ||
import io.opentelemetry.exporter.otlp.profiles.ProfileContainerData; | ||
import io.opentelemetry.exporter.otlp.profiles.ProfileData; | ||
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; | ||
|
||
/** | ||
* Auto value implementation of {@link ProfileContainerData}, which represents a single profile. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
@Immutable | ||
@AutoValue | ||
public abstract class ImmutableProfileContainerData implements ProfileContainerData { | ||
|
||
/** | ||
* Returns a new ProfileContainerData representing the given profile information. | ||
* | ||
* @return a new ProfileContainerData representing the given profile information. | ||
*/ | ||
@SuppressWarnings("TooManyParameters") | ||
public static ProfileContainerData create( | ||
Resource resource, | ||
InstrumentationScopeInfo instrumentationScopeInfo, | ||
String profileId, | ||
long startEpochNanos, | ||
long endEpochNanos, | ||
Attributes attributes, | ||
int totalAttributeCount, | ||
@Nullable String originalPayloadFormat, | ||
ByteBuffer originalPayload, | ||
ProfileData profile) { | ||
return new AutoValue_ImmutableProfileContainerData( | ||
resource, | ||
instrumentationScopeInfo, | ||
profileId, | ||
startEpochNanos, | ||
endEpochNanos, | ||
attributes, | ||
totalAttributeCount, | ||
originalPayloadFormat, | ||
originalPayload, | ||
profile); | ||
} | ||
|
||
ImmutableProfileContainerData() {} | ||
|
||
public ByteBuffer getOriginalPayloadReadOnly() { | ||
return getOriginalPayload().asReadOnlyBuffer(); | ||
} | ||
} |
Oops, something went wrong.