-
Notifications
You must be signed in to change notification settings - Fork 831
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 classes for experimental profiling signal type. (#6374
- Loading branch information
Showing
17 changed files
with
584 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
plugins { | ||
id("otel.java-conventions") | ||
id("otel.publish-conventions") | ||
|
||
id("otel.animalsniffer-conventions") | ||
} | ||
|
||
description = "OpenTelemetry - Profiles Exporter" | ||
otelJava.moduleName.set("io.opentelemetry.exporter.otlp.profiles") | ||
|
||
dependencies { | ||
api(project(":sdk:common")) | ||
} |
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 @@ | ||
otel.release=alpha |
39 changes: 39 additions & 0 deletions
39
...rofiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AggregationTemporality.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,39 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.profiles; | ||
|
||
/** | ||
* 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 { | ||
|
||
/** | ||
* DELTA is an AggregationTemporality for a profiler which reports changes since last report time. | ||
*/ | ||
DELTA, | ||
|
||
/** | ||
* CUMULATIVE is an AggregationTemporality for a profiler which reports changes since a fixed | ||
* start time. | ||
*/ | ||
CUMULATIVE | ||
} |
23 changes: 23 additions & 0 deletions
23
...tlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitData.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,23 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.profiles; | ||
|
||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Represents a mapping between Attribute Keys and Units. | ||
* | ||
* @see "pprofextended.proto::AttributeUnit" | ||
*/ | ||
@Immutable | ||
public interface AttributeUnitData { | ||
|
||
/** Index into string table. */ | ||
long getAttributeKey(); | ||
|
||
/** Index into string table. */ | ||
long getUnitIndex(); | ||
} |
20 changes: 20 additions & 0 deletions
20
...ters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/BuildIdKind.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,20 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.profiles; | ||
|
||
/** | ||
* Indicates the semantics of the build_id field. | ||
* | ||
* @see "pprofextended.proto::BuildIdKind" | ||
*/ | ||
public enum BuildIdKind { | ||
|
||
/** Linker-generated build ID, stored in the ELF binary notes. */ | ||
LINKER, | ||
|
||
/** Build ID based on the content hash of the binary. */ | ||
BINARY_HASH; | ||
} |
32 changes: 32 additions & 0 deletions
32
...ers/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/FunctionData.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.profiles; | ||
|
||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Describes a function. | ||
* | ||
* @see "pprofextended.proto::Function" | ||
*/ | ||
@Immutable | ||
public interface FunctionData { | ||
|
||
/** Name of the function, in human-readable form if available. Index into string table. */ | ||
long getNameIndex(); | ||
|
||
/** | ||
* Name of the function, as identified by the system. For instance, it can be a C++ mangled name. | ||
* Index into string table. | ||
*/ | ||
long getSystemNameIndex(); | ||
|
||
/** Source file containing the function. Index into string table. */ | ||
long getFilenameIndex(); | ||
|
||
/** Line number in source file. */ | ||
long getStartLine(); | ||
} |
33 changes: 33 additions & 0 deletions
33
exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LabelData.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.profiles; | ||
|
||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Provides additional context for a sample, such as thread ID or allocation size, with optional | ||
* units. | ||
* | ||
* @see "pprofextended.proto::Label" | ||
*/ | ||
@Immutable | ||
public interface LabelData { | ||
|
||
/** Index into string table. */ | ||
long getKeyIndex(); | ||
|
||
/** String value of the label data, if applicable. Index into string table */ | ||
long getStrIndex(); | ||
|
||
/** Numeric value of the label data, if applicable. */ | ||
long getNum(); | ||
|
||
/** | ||
* Specifies the units of num, applicable only if num is present. Use arbitrary string (for | ||
* example, "requests") as a custom count unit. | ||
*/ | ||
long getNumUnitIndex(); | ||
} |
26 changes: 26 additions & 0 deletions
26
exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LineData.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,26 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.profiles; | ||
|
||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Details a specific line in a source code, linked to a function. | ||
* | ||
* @see "pprofextended.proto::Line" | ||
*/ | ||
@Immutable | ||
public interface LineData { | ||
|
||
/** The index of the corresponding Function for this line. Index into function table. */ | ||
long getFunctionIndex(); | ||
|
||
/** Line number in source code. */ | ||
long getLine(); | ||
|
||
/** Column number in source code. */ | ||
long getColumn(); | ||
} |
26 changes: 26 additions & 0 deletions
26
exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LinkData.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,26 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.profiles; | ||
|
||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* A connection from a profile Sample to a trace Span. | ||
* | ||
* @see "pprofextended.proto::Link" | ||
*/ | ||
@Immutable | ||
public interface LinkData { | ||
|
||
/** | ||
* Returns a unique identifier of a trace that this linked span is part of as 32 character | ||
* lowercase hex String. | ||
*/ | ||
String getTraceId(); | ||
|
||
/** Returns a unique identifier for the linked span, as 16 character lowercase hex String. */ | ||
String getSpanId(); | ||
} |
45 changes: 45 additions & 0 deletions
45
...ers/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationData.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,45 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.profiles; | ||
|
||
import java.util.List; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Describes a function. | ||
* | ||
* @see "pprofextended.proto::Location" | ||
*/ | ||
@Immutable | ||
public interface LocationData { | ||
|
||
/** | ||
* The index of the corresponding profile.Mapping for this location. It can be unset if the | ||
* mapping is unknown or not applicable for this profile type. | ||
*/ | ||
long getMappingIndex(); | ||
|
||
/** The instruction address for this location, if available. */ | ||
long getAddress(); | ||
|
||
/** | ||
* Multiple line indicates this location has inlined functions, where the last entry represents | ||
* the caller into which the preceding entries were inlined. | ||
*/ | ||
List<LineData> getLines(); | ||
|
||
/** | ||
* Provides an indication that multiple symbols map to this location's address, for example due to | ||
* identical code folding by the linker. | ||
*/ | ||
boolean isFolded(); | ||
|
||
/** Type of frame (e.g. kernel, native, python, hotspot, php). Index into string table. */ | ||
int getTypeIndex(); | ||
|
||
/** References to attributes in Profile.attribute_table. */ | ||
List<Long> getAttributes(); | ||
} |
54 changes: 54 additions & 0 deletions
54
...ters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/MappingData.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,54 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.otlp.profiles; | ||
|
||
import java.util.List; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* Describes the mapping of a binary in memory. | ||
* | ||
* @see "pprofextended.proto::Mapping" | ||
*/ | ||
@Immutable | ||
public interface MappingData { | ||
|
||
/** Address at which the binary (or DLL) is loaded into memory. */ | ||
long getMemoryStart(); | ||
|
||
/** The limit of the address range occupied by this mapping. */ | ||
long getMemoryLimit(); | ||
|
||
/** Offset in the binary that corresponds to the first mapped address. */ | ||
long getFileOffset(); | ||
|
||
/** | ||
* The object this entry is loaded from. This can be a filename on disk for the main binary and | ||
* shared libraries, or virtual abstraction like "[vdso]". Index into the string table. | ||
*/ | ||
long getFilenameIndex(); | ||
|
||
/** | ||
* Uniquely identifies a particular program version with high probability. e.g., for binaries | ||
* generated by GNU tools, the contents of the .note.gnu.build-id field. Index into the string | ||
* table. | ||
*/ | ||
long getBuildIdIndex(); | ||
|
||
/** Specifies the kind of build id. See BuildIdKind enum for more details */ | ||
BuildIdKind getBuildIdKind(); | ||
|
||
/** References to attributes in Profile.attribute_table. */ | ||
List<Long> getAttributeIndices(); | ||
|
||
boolean hasFunctions(); | ||
|
||
boolean hasFilenames(); | ||
|
||
boolean hasLineNumbers(); | ||
|
||
boolean hasInlineFrames(); | ||
} |
Oops, something went wrong.