Skip to content

Commit 408b4e9

Browse files
committed
Update opentelementry-proto to 1.4
1 parent 6487ac2 commit 408b4e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+540
-851
lines changed

buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,13 @@ if (!project.hasProperty("otel.release") && !project.name.startsWith("bom")) {
181181

182182
// this is needed so that we only consider the current artifact, and not dependencies
183183
ignoreMissingClasses.set(true)
184-
packageExcludes.addAll("*.internal", "*.internal.*", "io.opentelemetry.internal.shaded.jctools.*")
184+
packageExcludes.addAll(
185+
"*.internal",
186+
"*.internal.*",
187+
"io.opentelemetry.internal.shaded.jctools.*",
188+
// Temporarily suppress warnings from public generated classes from :sdk-extensions:jaeger-remote-sampler
189+
"io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2"
190+
)
185191
val baseVersionString = if (apiBaseVersion == null) "latest" else baselineVersion
186192
txtOutputFile.set(
187193
apiNewVersion?.let { file("$rootDir/docs/apidiffs/${apiNewVersion}_vs_$baselineVersion/${base.archivesName.get()}.txt") }

dependencyManagement/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ rootProject.extra["versions"] = dependencyVersions
1010
val DEPENDENCY_BOMS = listOf(
1111
"com.fasterxml.jackson:jackson-bom:2.18.1",
1212
"com.google.guava:guava-bom:33.3.1-jre",
13-
"com.google.protobuf:protobuf-bom:3.25.5",
13+
"com.google.protobuf:protobuf-bom:4.28.3",
1414
"com.linecorp.armeria:armeria-bom:1.31.1",
1515
"com.squareup.okhttp3:okhttp-bom:4.12.0",
1616
"com.squareup.okio:okio-bom:3.9.1", // applies to transitive dependencies of okhttp
@@ -69,7 +69,7 @@ val DEPENDENCIES = listOf(
6969
"io.jaegertracing:jaeger-client:1.8.1",
7070
"io.opentelemetry.contrib:opentelemetry-aws-xray-propagator:1.39.0-alpha",
7171
"io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.28.0-alpha",
72-
"io.opentelemetry.proto:opentelemetry-proto:1.3.2-alpha",
72+
"io.opentelemetry.proto:opentelemetry-proto:1.4.0-alpha",
7373
"io.opentracing:opentracing-api:0.33.0",
7474
"io.opentracing:opentracing-noop:0.33.0",
7575
"io.prometheus:prometheus-metrics-exporter-httpserver:1.3.3",

exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/MarshalerUtil.java

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,46 @@ public static int sizeRepeatedInt64(ProtoFieldInfo field, List<Long> values) {
215215
return field.getTagSize() + CodedOutputStream.computeUInt32SizeNoTag(payloadSize) + payloadSize;
216216
}
217217

218+
/**
219+
* Returns the size of a repeated int32 field.
220+
*
221+
* <p>Packed repeated fields contain the tag, an integer representing the incoming payload size,
222+
* and an actual payload of repeated varints.
223+
*/
224+
public static int sizeRepeatedInt32(ProtoFieldInfo field, int[] values) {
225+
if (values.length == 0) {
226+
return 0;
227+
}
228+
229+
int payloadSize = 0;
230+
for (int v : values) {
231+
payloadSize += CodedOutputStream.computeInt32SizeNoTag(v);
232+
}
233+
234+
// tag size + payload indicator size + actual payload size
235+
return field.getTagSize() + CodedOutputStream.computeUInt32SizeNoTag(payloadSize) + payloadSize;
236+
}
237+
238+
/**
239+
* Returns the size of a repeated int32 field.
240+
*
241+
* <p>Packed repeated fields contain the tag, an integer representing the incoming payload size,
242+
* and an actual payload of repeated varints.
243+
*/
244+
public static int sizeRepeatedInt32(ProtoFieldInfo field, List<Integer> values) {
245+
if (values.isEmpty()) {
246+
return 0;
247+
}
248+
249+
int payloadSize = 0;
250+
for (int v : values) {
251+
payloadSize += CodedOutputStream.computeInt32SizeNoTag(v);
252+
}
253+
254+
// tag size + payload indicator size + actual payload size
255+
return field.getTagSize() + CodedOutputStream.computeUInt32SizeNoTag(payloadSize) + payloadSize;
256+
}
257+
218258
/** Returns the size of a repeated double field. */
219259
public static int sizeRepeatedDouble(ProtoFieldInfo field, List<Double> values) {
220260
// Same as fixed64.
@@ -300,6 +340,19 @@ public static int sizeInt32(ProtoFieldInfo field, int message) {
300340
return field.getTagSize() + CodedOutputStream.computeInt32SizeNoTag(message);
301341
}
302342

343+
/** Returns the size of an optional int32 field. */
344+
public static int sizeInt32Optional(ProtoFieldInfo field, int message) {
345+
return field.getTagSize() + CodedOutputStream.computeInt32SizeNoTag(message);
346+
}
347+
348+
/** Returns the size of an optional int32 field. */
349+
public static int sizeInt32Optional(ProtoFieldInfo field, @Nullable Integer message) {
350+
if (message == null) {
351+
return 0;
352+
}
353+
return sizeInt32Optional(field, (int) message);
354+
}
355+
303356
/** Returns the size of a double field. */
304357
public static int sizeDouble(ProtoFieldInfo field, double value) {
305358
if (value == 0D) {

exporters/common/src/main/java/io/opentelemetry/exporter/internal/marshal/Serializer.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,27 @@ public void serializeSInt32(ProtoFieldInfo field, int value) throws IOException
122122

123123
protected abstract void writeSInt32(ProtoFieldInfo info, int value) throws IOException;
124124

125-
/** Serializes a protobuf {@code uint32} field. */
125+
/** Serializes a protobuf {@code int32} field. */
126126
public void serializeInt32(ProtoFieldInfo field, int value) throws IOException {
127127
if (value == 0) {
128128
return;
129129
}
130130
writeint32(field, value);
131131
}
132132

133+
/** Serializes a protobuf {@code int32} field. */
134+
public void serializeInt32Optional(ProtoFieldInfo field, int value) throws IOException {
135+
writeint32(field, value);
136+
}
137+
138+
/** Serializes a protobuf {@code int32} field. */
139+
public void serializeInt32Optional(ProtoFieldInfo field, @Nullable Integer value)
140+
throws IOException {
141+
if (value != null) {
142+
serializeInt32Optional(field, (int) value);
143+
}
144+
}
145+
133146
protected abstract void writeint32(ProtoFieldInfo field, int value) throws IOException;
134147

135148
/** Serializes a protobuf {@code int64} field. */
@@ -323,6 +336,25 @@ protected abstract void writeStartRepeatedVarint(ProtoFieldInfo field, int paylo
323336

324337
protected abstract void writeEndRepeatedVarint() throws IOException;
325338

339+
/** Serializes a {@code repeated int32} field. */
340+
public void serializeRepeatedInt32(ProtoFieldInfo field, List<Integer> values)
341+
throws IOException {
342+
if (values.isEmpty()) {
343+
return;
344+
}
345+
346+
int payloadSize = 0;
347+
for (int v : values) {
348+
payloadSize += CodedOutputStream.computeInt32SizeNoTag(v);
349+
}
350+
351+
writeStartRepeatedVarint(field, payloadSize);
352+
for (int value : values) {
353+
writeUInt64Value(value);
354+
}
355+
writeEndRepeatedVarint();
356+
}
357+
326358
/** Serializes a {@code repeated fixed64} field. */
327359
public void serializeRepeatedFixed64(ProtoFieldInfo field, List<Long> values) throws IOException {
328360
if (values.isEmpty()) {

exporters/otlp/common/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ wire {
4242
"opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest",
4343
"opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest",
4444
"opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest",
45-
"opentelemetry.proto.collector.profiles.v1experimental.ExportProfilesServiceRequest"
45+
"opentelemetry.proto.collector.profiles.v1development.ExportProfilesServiceRequest"
4646
)
4747

4848
custom {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public abstract class ImmutableAttributeUnitData implements AttributeUnitData {
2525
*
2626
* @return a new AttributeUnitData mapping the given key to the given unit.
2727
*/
28-
public static AttributeUnitData create(long attributeKey, long unitIndex) {
29-
return new AutoValue_ImmutableAttributeUnitData(attributeKey, unitIndex);
28+
public static AttributeUnitData create(int attributeKeyStrindex, int unitStrindex) {
29+
return new AutoValue_ImmutableAttributeUnitData(attributeKeyStrindex, unitStrindex);
3030
}
3131

3232
ImmutableAttributeUnitData() {}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public abstract class ImmutableFunctionData implements FunctionData {
2525
* @return a new FunctionData describing the given function characteristics.
2626
*/
2727
public static FunctionData create(
28-
long nameIndex, long systemNameIndex, long filenameIndex, long startLine) {
28+
int nameStrindex, int systemNameStrindex, int filenameStrindex, long startLine) {
2929
return new AutoValue_ImmutableFunctionData(
30-
nameIndex, systemNameIndex, filenameIndex, startLine);
30+
nameStrindex, systemNameStrindex, filenameStrindex, startLine);
3131
}
3232

3333
ImmutableFunctionData() {}

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public abstract class ImmutableLineData implements LineData {
2525
*
2626
* @return a new LineData describing the given details a specific line in a source code.
2727
*/
28-
public static LineData create(long functionIndex, long line, long column) {
28+
public static LineData create(int functionIndex, long line, long column) {
2929
return new AutoValue_ImmutableLineData(functionIndex, line, column);
3030
}
3131

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ 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-
long mappingIndex,
31+
Integer mappingIndex,
3232
long address,
3333
List<LineData> lines,
3434
boolean folded,
35-
int typeIndex,
36-
List<Long> attributes) {
35+
List<Integer> attributeIndices) {
3736
return new AutoValue_ImmutableLocationData(
38-
mappingIndex, address, lines, folded, typeIndex, attributes);
37+
mappingIndex, address, lines, folded, attributeIndices);
3938
}
4039

4140
ImmutableLocationData() {}

0 commit comments

Comments
 (0)