Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exporter data model impl for profiling signal type. #6498

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions exporters/otlp/profiles/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ otelJava.moduleName.set("io.opentelemetry.exporter.otlp.profiles")

dependencies {
api(project(":sdk:common"))

annotationProcessor("com.google.auto.value:auto-value")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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;

@Immutable
@AutoValue
public abstract class ImmutableAttributeUnitData implements AttributeUnitData {
jack-berg marked this conversation as resolved.
Show resolved Hide resolved

public static AttributeUnitData create(long attributeKey, long unitIndex) {
return new AutoValue_ImmutableAttributeUnitData(attributeKey, unitIndex);

Check warning on line 17 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java#L17

Added line #L17 was not covered by tests
}

ImmutableAttributeUnitData() {}

Check warning on line 20 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableAttributeUnitData.java#L20

Added line #L20 was not covered by tests
}
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.internal.data;

import com.google.auto.value.AutoValue;
import io.opentelemetry.exporter.otlp.profiles.FunctionData;
import javax.annotation.concurrent.Immutable;

@Immutable
@AutoValue
public abstract class ImmutableFunctionData implements FunctionData {

public static FunctionData create(
long nameIndex, long systemNameIndex, long filenameIndex, long startLine) {
return new AutoValue_ImmutableFunctionData(

Check warning on line 18 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java#L18

Added line #L18 was not covered by tests
nameIndex, systemNameIndex, filenameIndex, startLine);
}

ImmutableFunctionData() {}

Check warning on line 22 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableFunctionData.java#L22

Added line #L22 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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;

@Immutable
@AutoValue
public abstract class ImmutableLabelData implements LabelData {

public static LabelData create(long keyIndex, long strIndex, long num, long numUnitIndex) {
return new AutoValue_ImmutableLabelData(keyIndex, strIndex, num, numUnitIndex);

Check warning on line 17 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLabelData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLabelData.java#L17

Added line #L17 was not covered by tests
}

ImmutableLabelData() {}

Check warning on line 20 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLabelData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLabelData.java#L20

Added line #L20 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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;

@Immutable
@AutoValue
public abstract class ImmutableLineData implements LineData {

public static LineData create(long functionIndex, long line, long column) {
return new AutoValue_ImmutableLineData(functionIndex, line, column);

Check warning on line 17 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java#L17

Added line #L17 was not covered by tests
}

ImmutableLineData() {}

Check warning on line 20 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLineData.java#L20

Added line #L20 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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;

@Immutable
@AutoValue
public abstract class ImmutableLinkData implements LinkData {

public static LinkData create(String traceId, String spanId) {
return new AutoValue_ImmutableLinkData(traceId, spanId);

Check warning on line 17 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLinkData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLinkData.java#L17

Added line #L17 was not covered by tests
}

ImmutableLinkData() {}

Check warning on line 20 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLinkData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLinkData.java#L20

Added line #L20 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* 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;

@Immutable
@AutoValue
public abstract class ImmutableLocationData implements LocationData {

public static LocationData create(
long mappingIndex,
long address,
List<LineData> lines,
boolean folded,
int typeIndex,
List<Long> attributes) {
return new AutoValue_ImmutableLocationData(

Check warning on line 25 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java#L25

Added line #L25 was not covered by tests
mappingIndex, address, lines, folded, typeIndex, attributes);
}

ImmutableLocationData() {}

Check warning on line 29 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableLocationData.java#L29

Added line #L29 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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;

@Immutable
@AutoValue
public abstract class ImmutableMappingData implements MappingData {

@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(

Check warning on line 31 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java#L31

Added line #L31 was not covered by tests
memoryStart,
memoryLimit,
fileOffset,
filenameIndex,
buildIdIndex,
buildIdKind,
attributeIndices,
hasFunctions,
hasFilenames,
hasLineNumbers,
hasInlineFrames);
}

ImmutableMappingData() {}

Check warning on line 45 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableMappingData.java#L45

Added line #L45 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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;

@Immutable
@AutoValue
public abstract class ImmutableProfileContainerData implements ProfileContainerData {

@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(

Check warning on line 34 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java#L34

Added line #L34 was not covered by tests
resource,
instrumentationScopeInfo,
profileId,
startEpochNanos,
endEpochNanos,
attributes,
totalAttributeCount,
originalPayloadFormat,
originalPayload,
profile);
}

ImmutableProfileContainerData() {}

Check warning on line 47 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java#L47

Added line #L47 was not covered by tests

public ByteBuffer getOriginalPayloadReadOnly() {
return getOriginalPayload().asReadOnlyBuffer();

Check warning on line 50 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileContainerData.java#L50

Added line #L50 was not covered by tests
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* 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.AttributeUnitData;
import io.opentelemetry.exporter.otlp.profiles.FunctionData;
import io.opentelemetry.exporter.otlp.profiles.LinkData;
import io.opentelemetry.exporter.otlp.profiles.LocationData;
import io.opentelemetry.exporter.otlp.profiles.MappingData;
import io.opentelemetry.exporter.otlp.profiles.ProfileData;
import io.opentelemetry.exporter.otlp.profiles.SampleData;
import io.opentelemetry.exporter.otlp.profiles.ValueTypeData;
import java.util.List;
import javax.annotation.concurrent.Immutable;

@Immutable
@AutoValue
public abstract class ImmutableProfileData implements ProfileData {

@SuppressWarnings("TooManyParameters")
public static ProfileData create(
List<ValueTypeData> sampleTypes,
List<SampleData> samples,
List<MappingData> mappings,
List<LocationData> locations,
List<Long> locationIndices,
List<FunctionData> functions,
Attributes attributes,
List<AttributeUnitData> attributeUnits,
List<LinkData> links,
List<String> stringTable,
long dropFrames,
long keepFrames,
long timeNanos,
long durationNanos,
ValueTypeData periodType,
long period,
List<Long> comment,
long defaultSampleType) {
return new AutoValue_ImmutableProfileData(

Check warning on line 45 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java#L45

Added line #L45 was not covered by tests
sampleTypes,
samples,
mappings,
locations,
locationIndices,
functions,
attributes,
attributeUnits,
links,
stringTable,
dropFrames,
keepFrames,
timeNanos,
durationNanos,
periodType,
period,
comment,
defaultSampleType);
}

ImmutableProfileData() {}

Check warning on line 66 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java#L66

Added line #L66 was not covered by tests
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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.SampleData;
import java.util.List;
import javax.annotation.concurrent.Immutable;

@Immutable
@AutoValue
public abstract class ImmutableSampleData implements SampleData {

public static SampleData create(
long locationsStartIndex,
long locationsLength,
int stacktraceIdIndex,
List<Long> values,
List<Long> attributes,
long link,
List<Long> timestamps) {
return new AutoValue_ImmutableSampleData(

Check warning on line 25 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableSampleData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableSampleData.java#L25

Added line #L25 was not covered by tests
locationsStartIndex,
locationsLength,
stacktraceIdIndex,
values,
attributes,
link,
timestamps);
}

ImmutableSampleData() {}

Check warning on line 35 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableSampleData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableSampleData.java#L35

Added line #L35 was not covered by tests
}
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.internal.data;

import com.google.auto.value.AutoValue;
import io.opentelemetry.exporter.otlp.profiles.AggregationTemporality;
import io.opentelemetry.exporter.otlp.profiles.ValueTypeData;
import javax.annotation.concurrent.Immutable;

@Immutable
@AutoValue
public abstract class ImmutableValueTypeData implements ValueTypeData {

public static ValueTypeData create(
long type, long unit, AggregationTemporality aggregationTemporality) {
return new AutoValue_ImmutableValueTypeData(type, unit, aggregationTemporality);

Check warning on line 19 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableValueTypeData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableValueTypeData.java#L19

Added line #L19 was not covered by tests
}

ImmutableValueTypeData() {}

Check warning on line 22 in exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableValueTypeData.java

View check run for this annotation

Codecov / codecov/patch

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableValueTypeData.java#L22

Added line #L22 was not covered by tests
}
Loading