Skip to content

Commit fd7d014

Browse files
fix(deps): update dependency io.opentelemetry.semconv:opentelemetry-semconv-incubating to v1.39.0-alpha (#8022)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jack Berg <johnmberg8@gmail.com>
1 parent 775e578 commit fd7d014

6 files changed

Lines changed: 15 additions & 12 deletions

File tree

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ val DEPENDENCIES = listOf(
8181
"io.github.netmikey.logunit:logunit-jul:2.0.0",
8282
"io.jaegertracing:jaeger-client:1.8.1",
8383
"io.opentelemetry.contrib:opentelemetry-aws-xray-propagator:1.53.0-alpha",
84-
"io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.37.0-alpha",
84+
"io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.39.0-alpha",
8585
"io.opentelemetry.proto:opentelemetry-proto:1.9.0-alpha",
8686
"io.opentracing:opentracing-api:0.33.0",
8787
"io.opentracing:opentracing-noop:0.33.0",

exporters/common/src/main/java/io/opentelemetry/exporter/internal/grpc/GrpcExporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private void onResponse(
8080
GrpcResponse grpcResponse) {
8181
GrpcStatusCode statusCode = grpcResponse.getStatusCode();
8282

83-
metricRecording.setGrpcStatusCode(statusCode.getValue());
83+
metricRecording.setGrpcStatusCode(statusCode);
8484

8585
if (statusCode == GrpcStatusCode.OK) {
8686
metricRecording.finishSuccessful();

exporters/common/src/main/java/io/opentelemetry/exporter/internal/metrics/ExporterInstrumentation.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import io.opentelemetry.api.common.AttributesBuilder;
1010
import io.opentelemetry.api.metrics.MeterProvider;
1111
import io.opentelemetry.sdk.common.InternalTelemetryVersion;
12+
import io.opentelemetry.sdk.common.export.GrpcStatusCode;
1213
import io.opentelemetry.sdk.common.internal.SemConvAttributes;
1314
import io.opentelemetry.sdk.common.internal.Signal;
1415
import io.opentelemetry.sdk.common.internal.StandardComponentId;
@@ -84,7 +85,7 @@ public static class Recording {
8485

8586
private final ExporterMetrics.Recording delegate;
8687
@Nullable private Long httpStatusCode;
87-
@Nullable private Long grpcStatusCode;
88+
@Nullable private GrpcStatusCode grpcStatusCode;
8889

8990
private Recording(ExporterMetrics.Recording delegate) {
9091
this.delegate = delegate;
@@ -98,7 +99,7 @@ public void setHttpStatusCode(long httpStatusCode) {
9899
this.httpStatusCode = httpStatusCode;
99100
}
100101

101-
public void setGrpcStatusCode(long grpcStatusCode) {
102+
public void setGrpcStatusCode(GrpcStatusCode grpcStatusCode) {
102103
if (httpStatusCode != null) {
103104
throw new IllegalStateException(
104105
"HTTP status code already set, can only set either gRPC or HTTP");
@@ -135,7 +136,7 @@ private Attributes buildRequestAttributes() {
135136
return Attributes.of(SemConvAttributes.HTTP_RESPONSE_STATUS_CODE, httpStatusCode);
136137
}
137138
if (grpcStatusCode != null) {
138-
return Attributes.of(SemConvAttributes.RPC_GRPC_STATUS_CODE, grpcStatusCode);
139+
return Attributes.of(SemConvAttributes.RPC_RESPONSE_STATUS_CODE, grpcStatusCode.name());
139140
}
140141
return Attributes.empty();
141142
}

exporters/common/src/test/java/io/opentelemetry/exporter/internal/grpc/GrpcExporterTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ void testInternalTelemetry(StandardComponentId.ExporterType exporterType) {
198198
pa ->
199199
pa.hasAttributes(
200200
expectedAttributes.toBuilder()
201-
.put(SemConvAttributes.RPC_GRPC_STATUS_CODE, 0)
201+
.put(
202+
SemConvAttributes.RPC_RESPONSE_STATUS_CODE,
203+
GrpcStatusCode.OK.name())
202204
.build())
203205
.hasBucketCounts(1),
204206
pa ->
@@ -208,8 +210,8 @@ void testInternalTelemetry(StandardComponentId.ExporterType exporterType) {
208210
SemConvAttributes.ERROR_TYPE,
209211
"" + UNAVAILABLE.getValue())
210212
.put(
211-
SemConvAttributes.RPC_GRPC_STATUS_CODE,
212-
UNAVAILABLE.getValue())
213+
SemConvAttributes.RPC_RESPONSE_STATUS_CODE,
214+
UNAVAILABLE.name())
213215
.build())
214216
.hasBucketCounts(1),
215217
pa ->

sdk/common/src/main/java/io/opentelemetry/sdk/common/internal/SemConvAttributes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ private SemConvAttributes() {}
2929
AttributeKey.stringKey("server.address");
3030
public static final AttributeKey<Long> SERVER_PORT = AttributeKey.longKey("server.port");
3131

32-
public static final AttributeKey<Long> RPC_GRPC_STATUS_CODE =
33-
AttributeKey.longKey("rpc.grpc.status_code");
32+
public static final AttributeKey<String> RPC_RESPONSE_STATUS_CODE =
33+
AttributeKey.stringKey("rpc.response.status_code");
3434
public static final AttributeKey<Long> HTTP_RESPONSE_STATUS_CODE =
3535
AttributeKey.longKey("http.response.status_code");
3636

sdk/common/src/test/java/io/opentelemetry/sdk/common/internal/SemConvAttributesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ void testAttributeKeys() {
2727

2828
assertThat(SemConvAttributes.SERVER_ADDRESS).isEqualTo(ServerAttributes.SERVER_ADDRESS);
2929
assertThat(SemConvAttributes.SERVER_PORT).isEqualTo(ServerAttributes.SERVER_PORT);
30-
assertThat(SemConvAttributes.RPC_GRPC_STATUS_CODE)
31-
.isEqualTo(RpcIncubatingAttributes.RPC_GRPC_STATUS_CODE);
30+
assertThat(SemConvAttributes.RPC_RESPONSE_STATUS_CODE)
31+
.isEqualTo(RpcIncubatingAttributes.RPC_RESPONSE_STATUS_CODE);
3232
assertThat(SemConvAttributes.HTTP_RESPONSE_STATUS_CODE)
3333
.isEqualTo(HttpAttributes.HTTP_RESPONSE_STATUS_CODE);
3434

0 commit comments

Comments
 (0)