Skip to content

Commit 93d9e72

Browse files
fix(deps): update dependency io.opentelemetry.proto:opentelemetry-proto to v1.7.0-alpha (#7362)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jack Berg <[email protected]>
1 parent b11316b commit 93d9e72

File tree

10 files changed

+299
-144
lines changed

10 files changed

+299
-144
lines changed

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ val DEPENDENCIES = listOf(
8585
"io.jaegertracing:jaeger-client:1.8.1",
8686
"io.opentelemetry.contrib:opentelemetry-aws-xray-propagator:1.46.0-alpha",
8787
"io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.32.0-alpha",
88-
"io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha",
88+
"io.opentelemetry.proto:opentelemetry-proto:1.7.0-alpha",
8989
"io.opentracing:opentracing-api:0.33.0",
9090
"io.opentracing:opentracing-noop:0.33.0",
9191
"junit:junit:4.13.2",

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

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@
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;
11-
import io.opentelemetry.exporter.otlp.profiles.FunctionData;
12-
import io.opentelemetry.exporter.otlp.profiles.LinkData;
13-
import io.opentelemetry.exporter.otlp.profiles.LocationData;
14-
import io.opentelemetry.exporter.otlp.profiles.MappingData;
159
import io.opentelemetry.exporter.otlp.profiles.ProfileData;
10+
import io.opentelemetry.exporter.otlp.profiles.ProfileDictionaryData;
1611
import io.opentelemetry.exporter.otlp.profiles.SampleData;
1712
import io.opentelemetry.exporter.otlp.profiles.ValueTypeData;
1813
import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
@@ -23,8 +18,7 @@
2318

2419
/**
2520
* Auto value implementation of {@link ProfileData}, which represents a complete profile, including
26-
* sample types, samples, mappings to binaries, locations, functions, string table, and additional
27-
* metadata.
21+
* sample types, samples, mappings to binaries, locations, and additional metadata.
2822
*
2923
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
3024
* at any time.
@@ -42,16 +36,10 @@ public abstract class ImmutableProfileData implements ProfileData {
4236
public static ProfileData create(
4337
Resource resource,
4438
InstrumentationScopeInfo instrumentationScopeInfo,
39+
ProfileDictionaryData profileDictionaryData,
4540
List<ValueTypeData> sampleTypes,
4641
List<SampleData> samples,
47-
List<MappingData> mappingTable,
48-
List<LocationData> locationTable,
4942
List<Integer> locationIndices,
50-
List<FunctionData> functionTable,
51-
List<AttributeKeyValue<?>> attributeTable,
52-
List<AttributeUnitData> attributeUnits,
53-
List<LinkData> linkTable,
54-
List<String> stringTable,
5543
long timeNanos,
5644
long durationNanos,
5745
ValueTypeData periodType,
@@ -66,16 +54,10 @@ public static ProfileData create(
6654
return new AutoValue_ImmutableProfileData(
6755
resource,
6856
instrumentationScopeInfo,
57+
profileDictionaryData,
6958
sampleTypes,
7059
samples,
71-
mappingTable,
72-
locationTable,
7360
locationIndices,
74-
functionTable,
75-
attributeTable,
76-
attributeUnits,
77-
linkTable,
78-
stringTable,
7961
timeNanos,
8062
durationNanos,
8163
periodType,
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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.internal.otlp.AttributeKeyValue;
10+
import io.opentelemetry.exporter.otlp.profiles.AttributeUnitData;
11+
import io.opentelemetry.exporter.otlp.profiles.FunctionData;
12+
import io.opentelemetry.exporter.otlp.profiles.LinkData;
13+
import io.opentelemetry.exporter.otlp.profiles.LocationData;
14+
import io.opentelemetry.exporter.otlp.profiles.MappingData;
15+
import io.opentelemetry.exporter.otlp.profiles.ProfileDictionaryData;
16+
import java.util.List;
17+
import javax.annotation.concurrent.Immutable;
18+
19+
/**
20+
* Auto value implementation of {@link ProfileDictionaryData}, which represents profiles data shared
21+
* across the entire message being sent.
22+
*
23+
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
24+
* at any time.
25+
*/
26+
@Immutable
27+
@AutoValue
28+
public abstract class ImmutableProfileDictionaryData implements ProfileDictionaryData {
29+
30+
/**
31+
* Returns a new ProfileData representing the given data.
32+
*
33+
* @return a new ProfileData representing the given data.
34+
*/
35+
@SuppressWarnings("TooManyParameters")
36+
public static ProfileDictionaryData create(
37+
List<MappingData> mappingTable,
38+
List<LocationData> locationTable,
39+
List<FunctionData> functionTable,
40+
List<AttributeKeyValue<?>> attributeTable,
41+
List<AttributeUnitData> attributeUnits,
42+
List<LinkData> linkTable,
43+
List<String> stringTable) {
44+
return new AutoValue_ImmutableProfileDictionaryData(
45+
mappingTable,
46+
locationTable,
47+
functionTable,
48+
attributeTable,
49+
attributeUnits,
50+
linkTable,
51+
stringTable);
52+
}
53+
54+
ImmutableProfileDictionaryData() {}
55+
}

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

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package io.opentelemetry.exporter.otlp.profiles;
77

88
import io.opentelemetry.api.internal.OtelEncodingUtils;
9-
import io.opentelemetry.exporter.internal.otlp.AttributeKeyValue;
109
import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
1110
import io.opentelemetry.sdk.resources.Resource;
1211
import java.nio.ByteBuffer;
@@ -16,7 +15,7 @@
1615

1716
/**
1817
* Represents a complete profile, including sample types, samples, mappings to binaries, locations,
19-
* functions, string table, and additional metadata.
18+
* and additional metadata.
2019
*
2120
* @see "profiles.proto::Profile"
2221
*/
@@ -29,41 +28,18 @@ public interface ProfileData {
2928
/** Returns the instrumentation scope that generated this profile. */
3029
InstrumentationScopeInfo getInstrumentationScopeInfo();
3130

31+
/** Returns the dictionary data of this profile. */
32+
ProfileDictionaryData getProfileDictionaryData();
33+
3234
/** A description of the samples associated with each Sample.value. */
3335
List<ValueTypeData> getSampleTypes();
3436

3537
/** The set of samples recorded in this profile. */
3638
List<SampleData> getSamples();
3739

38-
/**
39-
* Mapping from address ranges to the image/binary/library mapped into that address range.
40-
* mapping[0] will be the main binary.
41-
*/
42-
List<MappingData> getMappingTable();
43-
44-
/** Locations referenced by samples via location_indices. */
45-
List<LocationData> getLocationTable();
46-
4740
/** Array of locations referenced by samples. */
4841
List<Integer> getLocationIndices();
4942

50-
/** Functions referenced by locations. */
51-
List<FunctionData> getFunctionTable();
52-
53-
/** Lookup table for attributes. */
54-
List<AttributeKeyValue<?>> getAttributeTable();
55-
56-
/** Represents a mapping between Attribute Keys and Units. */
57-
List<AttributeUnitData> getAttributeUnits();
58-
59-
/** Lookup table for links. */
60-
List<LinkData> getLinkTable();
61-
62-
/**
63-
* A common table for strings referenced by various messages. string_table[0] must always be "".
64-
*/
65-
List<String> getStringTable();
66-
6743
/** Time of collection (UTC) represented as nanoseconds past the epoch. */
6844
long getTimeNanos();
6945

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.exporter.otlp.profiles;
7+
8+
import io.opentelemetry.exporter.internal.otlp.AttributeKeyValue;
9+
import java.util.List;
10+
import javax.annotation.concurrent.Immutable;
11+
12+
/**
13+
* Represents profiles data shared across the entire message being sent.
14+
*
15+
* @see "profiles.proto::ProfilesDictionary"
16+
*/
17+
@Immutable
18+
public interface ProfileDictionaryData {
19+
20+
/**
21+
* Mapping from address ranges to the image/binary/library mapped into that address range.
22+
* mapping[0] will be the main binary.
23+
*/
24+
List<MappingData> getMappingTable();
25+
26+
/** Locations referenced by samples via location_indices. */
27+
List<LocationData> getLocationTable();
28+
29+
/** Functions referenced by locations. */
30+
List<FunctionData> getFunctionTable();
31+
32+
/** Lookup table for attributes. */
33+
List<AttributeKeyValue<?>> getAttributeTable();
34+
35+
/** Represents a mapping between Attribute Keys and Units. */
36+
List<AttributeUnitData> getAttributeUnits();
37+
38+
/** Lookup table for links. */
39+
List<LinkData> getLinkTable();
40+
41+
/**
42+
* A common table for strings referenced by various messages. string_table[0] must always be "".
43+
*/
44+
List<String> getStringTable();
45+
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.exporter.otlp.profiles;
7+
8+
import io.opentelemetry.exporter.internal.marshal.MarshalerUtil;
9+
import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize;
10+
import io.opentelemetry.exporter.internal.marshal.Serializer;
11+
import io.opentelemetry.exporter.internal.otlp.KeyValueMarshaler;
12+
import io.opentelemetry.proto.profiles.v1development.internal.ProfilesDictionary;
13+
import java.io.IOException;
14+
import java.nio.charset.StandardCharsets;
15+
16+
final class ProfileDictionaryMarshaler extends MarshalerWithSize {
17+
18+
private final MappingMarshaler[] mappingTableMarshalers;
19+
private final LocationMarshaler[] locationTableMarshalers;
20+
private final FunctionMarshaler[] functionTableMarshalers;
21+
private final KeyValueMarshaler[] attributeTableMarshalers;
22+
private final AttributeUnitMarshaler[] attributeUnitMarshalers;
23+
private final LinkMarshaler[] linkTableMarshalers;
24+
private final byte[][] stringTable;
25+
26+
static ProfileDictionaryMarshaler create(ProfileDictionaryData profileDictionaryData) {
27+
28+
MappingMarshaler[] mappingMarshalers =
29+
MappingMarshaler.createRepeated(profileDictionaryData.getMappingTable());
30+
LocationMarshaler[] locationMarshalers =
31+
LocationMarshaler.createRepeated(profileDictionaryData.getLocationTable());
32+
FunctionMarshaler[] functionMarshalers =
33+
FunctionMarshaler.createRepeated(profileDictionaryData.getFunctionTable());
34+
KeyValueMarshaler[] attributeTableMarshalers =
35+
KeyValueMarshaler.createRepeated(profileDictionaryData.getAttributeTable());
36+
AttributeUnitMarshaler[] attributeUnitsMarshalers =
37+
AttributeUnitMarshaler.createRepeated(profileDictionaryData.getAttributeUnits());
38+
LinkMarshaler[] linkMarshalers =
39+
LinkMarshaler.createRepeated(profileDictionaryData.getLinkTable());
40+
41+
byte[][] convertedStrings = new byte[profileDictionaryData.getStringTable().size()][];
42+
for (int i = 0; i < profileDictionaryData.getStringTable().size(); i++) {
43+
convertedStrings[i] =
44+
profileDictionaryData.getStringTable().get(i).getBytes(StandardCharsets.UTF_8);
45+
}
46+
47+
return new ProfileDictionaryMarshaler(
48+
mappingMarshalers,
49+
locationMarshalers,
50+
functionMarshalers,
51+
attributeTableMarshalers,
52+
attributeUnitsMarshalers,
53+
linkMarshalers,
54+
convertedStrings);
55+
}
56+
57+
private ProfileDictionaryMarshaler(
58+
MappingMarshaler[] mappingTableMarshalers,
59+
LocationMarshaler[] locationTableMarshalers,
60+
FunctionMarshaler[] functionTableMarshalers,
61+
KeyValueMarshaler[] attributeTableMarshalers,
62+
AttributeUnitMarshaler[] attributeUnitMarshalers,
63+
LinkMarshaler[] linkTableMarshalers,
64+
byte[][] stringTableUtf8) {
65+
super(
66+
calculateSize(
67+
mappingTableMarshalers,
68+
locationTableMarshalers,
69+
functionTableMarshalers,
70+
attributeTableMarshalers,
71+
attributeUnitMarshalers,
72+
linkTableMarshalers,
73+
stringTableUtf8));
74+
this.mappingTableMarshalers = mappingTableMarshalers;
75+
this.locationTableMarshalers = locationTableMarshalers;
76+
this.functionTableMarshalers = functionTableMarshalers;
77+
this.attributeTableMarshalers = attributeTableMarshalers;
78+
this.attributeUnitMarshalers = attributeUnitMarshalers;
79+
this.linkTableMarshalers = linkTableMarshalers;
80+
this.stringTable = stringTableUtf8;
81+
}
82+
83+
@Override
84+
protected void writeTo(Serializer output) throws IOException {
85+
output.serializeRepeatedMessage(ProfilesDictionary.MAPPING_TABLE, mappingTableMarshalers);
86+
output.serializeRepeatedMessage(ProfilesDictionary.LOCATION_TABLE, locationTableMarshalers);
87+
output.serializeRepeatedMessage(ProfilesDictionary.FUNCTION_TABLE, functionTableMarshalers);
88+
output.serializeRepeatedMessage(ProfilesDictionary.ATTRIBUTE_TABLE, attributeTableMarshalers);
89+
output.serializeRepeatedMessage(ProfilesDictionary.ATTRIBUTE_UNITS, attributeUnitMarshalers);
90+
output.serializeRepeatedMessage(ProfilesDictionary.LINK_TABLE, linkTableMarshalers);
91+
output.serializeRepeatedString(ProfilesDictionary.STRING_TABLE, stringTable);
92+
}
93+
94+
private static int calculateSize(
95+
MappingMarshaler[] mappingMarshalers,
96+
LocationMarshaler[] locationMarshalers,
97+
FunctionMarshaler[] functionMarshalers,
98+
KeyValueMarshaler[] attributeTableMarshalers,
99+
AttributeUnitMarshaler[] attributeUnitMarshalers,
100+
LinkMarshaler[] linkMarshalers,
101+
byte[][] stringTable) {
102+
int size;
103+
size = 0;
104+
size += MarshalerUtil.sizeRepeatedMessage(ProfilesDictionary.MAPPING_TABLE, mappingMarshalers);
105+
size +=
106+
MarshalerUtil.sizeRepeatedMessage(ProfilesDictionary.LOCATION_TABLE, locationMarshalers);
107+
size +=
108+
MarshalerUtil.sizeRepeatedMessage(ProfilesDictionary.FUNCTION_TABLE, functionMarshalers);
109+
size +=
110+
MarshalerUtil.sizeRepeatedMessage(
111+
ProfilesDictionary.ATTRIBUTE_TABLE, attributeTableMarshalers);
112+
size +=
113+
MarshalerUtil.sizeRepeatedMessage(
114+
ProfilesDictionary.ATTRIBUTE_UNITS, attributeUnitMarshalers);
115+
size += MarshalerUtil.sizeRepeatedMessage(ProfilesDictionary.LINK_TABLE, linkMarshalers);
116+
size += MarshalerUtil.sizeRepeatedString(ProfilesDictionary.STRING_TABLE, stringTable);
117+
118+
return size;
119+
}
120+
}

0 commit comments

Comments
 (0)