Skip to content

Commit eb2b668

Browse files
authored
update profiles exporters for changes in proto v1.8.0-alpha (#7638)
1 parent d4a1039 commit eb2b668

27 files changed

+449
-424
lines changed

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ val DEPENDENCIES = listOf(
8282
"io.jaegertracing:jaeger-client:1.8.1",
8383
"io.opentelemetry.contrib:opentelemetry-aws-xray-propagator:1.49.0-alpha",
8484
"io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.37.0-alpha",
85-
"io.opentelemetry.proto:opentelemetry-proto:1.7.0-alpha",
85+
"io.opentelemetry.proto:opentelemetry-proto:1.8.0-alpha",
8686
"io.opentracing:opentracing-api:0.33.0",
8787
"io.opentracing:opentracing-noop:0.33.0",
8888
"junit:junit:4.13.2",

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

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.exporter.otlp.internal.data;
7+
8+
import com.google.auto.value.AutoValue;
9+
import io.opentelemetry.api.common.Value;
10+
import io.opentelemetry.exporter.otlp.profiles.KeyValueAndUnitData;
11+
import javax.annotation.concurrent.Immutable;
12+
13+
/**
14+
* Auto value implementation of {@link KeyValueAndUnitData}, which describes a Key Value pair with
15+
* optional unit for the value.
16+
*
17+
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
18+
* at any time.
19+
*/
20+
@Immutable
21+
@AutoValue
22+
public abstract class ImmutableKeyValueAndUnitData implements KeyValueAndUnitData {
23+
24+
/** Returns a {@link KeyValueAndUnitData} for the given parameters. */
25+
public static ImmutableKeyValueAndUnitData create(
26+
int keyStringIndex, Value<?> value, int unitStringIndex) {
27+
return new AutoValue_ImmutableKeyValueAndUnitData(keyStringIndex, value, unitStringIndex);
28+
}
29+
30+
ImmutableKeyValueAndUnitData() {}
31+
}

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,8 @@ public abstract class ImmutableLocationData implements LocationData {
2828
* @return a new LocationData describing the given function and line table information.
2929
*/
3030
public static LocationData create(
31-
Integer mappingIndex,
32-
long address,
33-
List<LineData> lines,
34-
boolean folded,
35-
List<Integer> attributeIndices) {
36-
return new AutoValue_ImmutableLocationData(
37-
mappingIndex, address, lines, folded, attributeIndices);
31+
int mappingIndex, long address, List<LineData> lines, List<Integer> attributeIndices) {
32+
return new AutoValue_ImmutableLocationData(mappingIndex, address, lines, attributeIndices);
3833
}
3934

4035
ImmutableLocationData() {}

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,9 @@ public static MappingData create(
3232
long memoryLimit,
3333
long fileOffset,
3434
int filenameStringIndex,
35-
List<Integer> attributeIndices,
36-
boolean hasFunctions,
37-
boolean hasFilenames,
38-
boolean hasLineNumbers,
39-
boolean hasInlineFrames) {
35+
List<Integer> attributeIndices) {
4036
return new AutoValue_ImmutableMappingData(
41-
memoryStart,
42-
memoryLimit,
43-
fileOffset,
44-
filenameStringIndex,
45-
attributeIndices,
46-
hasFunctions,
47-
hasFilenames,
48-
hasLineNumbers,
49-
hasInlineFrames);
37+
memoryStart, memoryLimit, fileOffset, filenameStringIndex, attributeIndices);
5038
}
5139

5240
ImmutableMappingData() {}

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ public static ProfileData create(
3737
Resource resource,
3838
InstrumentationScopeInfo instrumentationScopeInfo,
3939
ProfileDictionaryData profileDictionaryData,
40-
List<ValueTypeData> sampleTypes,
40+
ValueTypeData sampleType,
4141
List<SampleData> samples,
42-
List<Integer> locationIndices,
4342
long timeNanos,
4443
long durationNanos,
4544
ValueTypeData periodType,
4645
long period,
4746
List<Integer> commentStrIndices,
48-
int defaultSampleTypeStringIndex,
4947
String profileId,
5048
List<Integer> attributeIndices,
5149
int droppedAttributesCount,
@@ -55,15 +53,13 @@ public static ProfileData create(
5553
resource,
5654
instrumentationScopeInfo,
5755
profileDictionaryData,
58-
sampleTypes,
56+
sampleType,
5957
samples,
60-
locationIndices,
6158
timeNanos,
6259
durationNanos,
6360
periodType,
6461
period,
6562
commentStrIndices,
66-
defaultSampleTypeStringIndex,
6763
profileId,
6864
attributeIndices,
6965
droppedAttributesCount,

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileDictionaryData.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
package io.opentelemetry.exporter.otlp.internal.data;
77

88
import com.google.auto.value.AutoValue;
9-
import io.opentelemetry.exporter.internal.otlp.AttributeKeyValue;
10-
import io.opentelemetry.exporter.otlp.profiles.AttributeUnitData;
119
import io.opentelemetry.exporter.otlp.profiles.FunctionData;
10+
import io.opentelemetry.exporter.otlp.profiles.KeyValueAndUnitData;
1211
import io.opentelemetry.exporter.otlp.profiles.LinkData;
1312
import io.opentelemetry.exporter.otlp.profiles.LocationData;
1413
import io.opentelemetry.exporter.otlp.profiles.MappingData;
1514
import io.opentelemetry.exporter.otlp.profiles.ProfileDictionaryData;
15+
import io.opentelemetry.exporter.otlp.profiles.StackData;
1616
import java.util.List;
1717
import javax.annotation.concurrent.Immutable;
1818

@@ -37,18 +37,18 @@ public static ProfileDictionaryData create(
3737
List<MappingData> mappingTable,
3838
List<LocationData> locationTable,
3939
List<FunctionData> functionTable,
40-
List<AttributeKeyValue<?>> attributeTable,
41-
List<AttributeUnitData> attributeUnits,
4240
List<LinkData> linkTable,
43-
List<String> stringTable) {
41+
List<String> stringTable,
42+
List<KeyValueAndUnitData> attributeTable,
43+
List<StackData> stackTable) {
4444
return new AutoValue_ImmutableProfileDictionaryData(
4545
mappingTable,
4646
locationTable,
4747
functionTable,
48-
attributeTable,
49-
attributeUnits,
5048
linkTable,
51-
stringTable);
49+
stringTable,
50+
attributeTable,
51+
stackTable);
5252
}
5353

5454
ImmutableProfileDictionaryData() {}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ public abstract class ImmutableSampleData implements SampleData {
2727
* @return a new SampleData representing the given program context.
2828
*/
2929
public static SampleData create(
30-
int locationsStartIndex,
31-
int locationsLength,
30+
int stackIndex,
3231
List<Long> values,
3332
List<Integer> attributeIndices,
34-
Integer linkIndex,
33+
int linkIndex,
3534
List<Long> timestamps) {
3635
return new AutoValue_ImmutableSampleData(
37-
locationsStartIndex, locationsLength, values, attributeIndices, linkIndex, timestamps);
36+
stackIndex, values, attributeIndices, linkIndex, timestamps);
3837
}
3938

4039
ImmutableSampleData() {}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.exporter.otlp.internal.data;
7+
8+
import com.google.auto.value.AutoValue;
9+
import io.opentelemetry.exporter.otlp.profiles.StackData;
10+
import java.util.List;
11+
import javax.annotation.concurrent.Immutable;
12+
13+
/**
14+
* Auto value implementation of {@link StackData}, which records a list of locations, starting from
15+
* the leaf frame.
16+
*
17+
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
18+
* at any time.
19+
*/
20+
@Immutable
21+
@AutoValue
22+
public abstract class ImmutableStackData implements StackData {
23+
24+
/**
25+
* Returns a new StackData representing the given list of frames.
26+
*
27+
* @return a new StackData representing the given list of frames.
28+
*/
29+
public static StackData create(List<Integer> locationIndices) {
30+
return new AutoValue_ImmutableStackData(locationIndices);
31+
}
32+
33+
ImmutableStackData() {}
34+
}

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/AttributeUnitData.java

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)