Skip to content

Commit e8f6b0e

Browse files
crossoverJieasweet-confluent
authored andcommitted
fix ci
1 parent 4516222 commit e8f6b0e

File tree

7 files changed

+30
-26
lines changed

7 files changed

+30
-26
lines changed

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcClientMetrics.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ public void onEnd(Context context, Attributes endAttributes, long endNanos) {
9898
clientDurationHistogram.record(
9999
(endNanos - state.startTimeNanos()) / NANOS_PER_MS, attributes, context);
100100

101-
Long rpcClientRequestBodySize = RpcMessageBodySizeUtil.getRpcClientRequestBodySize(
102-
endAttributes, state.startAttributes());
101+
Long rpcClientRequestBodySize =
102+
RpcMessageBodySizeUtil.getRpcClientRequestBodySize(endAttributes, state.startAttributes());
103103
if (rpcClientRequestBodySize != null && rpcClientRequestBodySize > 0) {
104104
clientRequestSize.record(rpcClientRequestBodySize, attributes, context);
105105
}
106106

107-
Long rpcClientResponseBodySize = RpcMessageBodySizeUtil.getRpcClientResponseBodySize(
108-
endAttributes, state.startAttributes());
107+
Long rpcClientResponseBodySize =
108+
RpcMessageBodySizeUtil.getRpcClientResponseBodySize(endAttributes, state.startAttributes());
109109
if (rpcClientResponseBodySize != null && rpcClientResponseBodySize > 0) {
110110
clientResponseSize.record(rpcClientResponseBodySize, attributes, context);
111111
}

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcCommonAttributesExtractor.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ public final void onEnd(
4949
REQUEST request,
5050
@Nullable RESPONSE response,
5151
@Nullable Throwable error) {
52-
internalSet(attributes, RPC_CLIENT_REQUEST_BODY_SIZE,
53-
(long) getter.getClientRequestSize(request));
54-
internalSet(attributes, RPC_CLIENT_RESPONSE_BODY_SIZE,
55-
(long) getter.getClientResponseSize(request));
56-
57-
internalSet(attributes, RPC_SERVER_REQUEST_BODY_SIZE,
58-
(long) getter.getServerRequestSize(request));
59-
internalSet(attributes, RPC_SERVER_RESPONSE_BODY_SIZE,
60-
(long) getter.getServerResponseSize(request));
52+
internalSet(
53+
attributes, RPC_CLIENT_REQUEST_BODY_SIZE, (long) getter.getClientRequestSize(request));
54+
internalSet(
55+
attributes, RPC_CLIENT_RESPONSE_BODY_SIZE, (long) getter.getClientResponseSize(request));
56+
57+
internalSet(
58+
attributes, RPC_SERVER_REQUEST_BODY_SIZE, (long) getter.getServerRequestSize(request));
59+
internalSet(
60+
attributes, RPC_SERVER_RESPONSE_BODY_SIZE, (long) getter.getServerResponseSize(request));
6161
}
6262
}

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcMessageBodySizeUtil.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,17 @@ static Long getRpcClientRequestBodySize(Attributes... attributesList) {
1818

1919
@Nullable
2020
static Long getRpcClientResponseBodySize(Attributes... attributesList) {
21-
return getAttribute(
22-
RpcCommonAttributesExtractor.RPC_CLIENT_RESPONSE_BODY_SIZE, attributesList);
21+
return getAttribute(RpcCommonAttributesExtractor.RPC_CLIENT_RESPONSE_BODY_SIZE, attributesList);
2322
}
2423

2524
@Nullable
2625
static Long getRpcServerRequestBodySize(Attributes... attributesList) {
2726
return getAttribute(RpcCommonAttributesExtractor.RPC_SERVER_REQUEST_BODY_SIZE, attributesList);
2827
}
28+
2929
@Nullable
3030
static Long getRpcServerResponseBodySize(Attributes... attributesList) {
31-
return getAttribute(
32-
RpcCommonAttributesExtractor.RPC_SERVER_RESPONSE_BODY_SIZE, attributesList);
31+
return getAttribute(RpcCommonAttributesExtractor.RPC_SERVER_RESPONSE_BODY_SIZE, attributesList);
3332
}
3433

3534
@Nullable

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcMetricsAdvice.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ static void applyServerDurationAdvice(DoubleHistogramBuilder builder) {
5757
ServerAttributes.SERVER_ADDRESS,
5858
ServerAttributes.SERVER_PORT));
5959
}
60+
6061
static void applyClientRequestSizeAdvice(LongHistogramBuilder builder) {
6162
if (!(builder instanceof ExtendedLongHistogramBuilder)) {
6263
return;

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcServerMetrics.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ public void onEnd(Context context, Attributes endAttributes, long endNanos) {
9898
serverDurationHistogram.record(
9999
(endNanos - state.startTimeNanos()) / NANOS_PER_MS, attributes, context);
100100

101-
Long rpcServerRequestBodySize = RpcMessageBodySizeUtil.getRpcServerRequestBodySize(
102-
endAttributes, state.startAttributes());
103-
if (rpcServerRequestBodySize != null && rpcServerRequestBodySize >0 ) {
101+
Long rpcServerRequestBodySize =
102+
RpcMessageBodySizeUtil.getRpcServerRequestBodySize(endAttributes, state.startAttributes());
103+
if (rpcServerRequestBodySize != null && rpcServerRequestBodySize > 0) {
104104
serverRequestSize.record(rpcServerRequestBodySize, attributes, context);
105105
}
106106

107-
Long rpcServerResponseBodySize = RpcMessageBodySizeUtil.getRpcServerResponseBodySize(
108-
endAttributes, state.startAttributes());
107+
Long rpcServerResponseBodySize =
108+
RpcMessageBodySizeUtil.getRpcServerResponseBodySize(endAttributes, state.startAttributes());
109109
if (rpcServerResponseBodySize != null && rpcServerResponseBodySize > 0) {
110110
serverResponseSize.record(rpcServerResponseBodySize, attributes, context);
111111
}

instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcClientMetricsTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ void collectsMetrics() {
8888
histogram ->
8989
histogram.hasPointsSatisfying(
9090
point ->
91-
point.hasSum(20 /* bytes */)
91+
point
92+
.hasSum(20 /* bytes */)
9293
.hasAttributesSatisfying(
9394
equalTo(RpcIncubatingAttributes.RPC_SYSTEM, "grpc"),
9495
equalTo(
@@ -115,7 +116,8 @@ void collectsMetrics() {
115116
histogram ->
116117
histogram.hasPointsSatisfying(
117118
point ->
118-
point.hasSum(10 /* bytes */)
119+
point
120+
.hasSum(10 /* bytes */)
119121
.hasAttributesSatisfying(
120122
equalTo(RpcIncubatingAttributes.RPC_SYSTEM, "grpc"),
121123
equalTo(

instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/rpc/RpcServerMetricsTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ void collectsMetrics() {
116116
histogram ->
117117
histogram.hasPointsSatisfying(
118118
point ->
119-
point.hasSum(20 /* bytes */)
119+
point
120+
.hasSum(20 /* bytes */)
120121
.hasAttributesSatisfying(
121122
equalTo(RpcIncubatingAttributes.RPC_SYSTEM, "grpc"),
122123
equalTo(
@@ -142,7 +143,8 @@ void collectsMetrics() {
142143
histogram ->
143144
histogram.hasPointsSatisfying(
144145
point ->
145-
point.hasSum(10 /* bytes */)
146+
point
147+
.hasSum(10 /* bytes */)
146148
.hasAttributesSatisfying(
147149
equalTo(RpcIncubatingAttributes.RPC_SYSTEM, "grpc"),
148150
equalTo(

0 commit comments

Comments
 (0)