Skip to content

Commit 8193e7c

Browse files
Rename message count properties
1 parent af42bf3 commit 8193e7c

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/TracingClientInterceptor.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626

2727
final class TracingClientInterceptor implements ClientInterceptor {
2828

29-
private static final AttributeKey<Long> GRPC_MESSAGES_RECEIVED =
30-
AttributeKey.longKey("grpc.messages.received");
31-
private static final AttributeKey<Long> GRPC_MESSAGES_SENT =
32-
AttributeKey.longKey("grpc.messages.sent");
29+
private static final AttributeKey<Long> GRPC_RECEIVED_MESSAGE_COUNT =
30+
AttributeKey.longKey("grpc.received.message_count");
31+
private static final AttributeKey<Long> GRPC_SENT_MESSAGE_COUNT =
32+
AttributeKey.longKey("grpc.sent.message_count");
3333
// copied from MessageIncubatingAttributes
3434
private static final AttributeKey<Long> MESSAGE_ID = AttributeKey.longKey("message.id");
3535
private static final AttributeKey<String> MESSAGE_TYPE = AttributeKey.stringKey("message.type");
@@ -175,9 +175,9 @@ public void onClose(Status status, Metadata trailers) {
175175
if (captureExperimentalSpanAttributes) {
176176
Span span = Span.fromContext(context);
177177
span.setAttribute(
178-
GRPC_MESSAGES_RECEIVED, RECEIVED_MESSAGE_ID_UPDATER.get(TracingClientCall.this));
178+
GRPC_RECEIVED_MESSAGE_COUNT, RECEIVED_MESSAGE_ID_UPDATER.get(TracingClientCall.this));
179179
span.setAttribute(
180-
GRPC_MESSAGES_SENT, SENT_MESSAGE_ID_UPDATER.get(TracingClientCall.this));
180+
GRPC_SENT_MESSAGE_COUNT, SENT_MESSAGE_ID_UPDATER.get(TracingClientCall.this));
181181
}
182182
instrumenter.end(context, request, status, status.getCause());
183183
try (Scope ignored = parentContext.makeCurrent()) {

instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/TracingServerInterceptor.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ final class TracingServerInterceptor implements ServerInterceptor {
2727

2828
private static final AttributeKey<Boolean> GRPC_CANCELED =
2929
AttributeKey.booleanKey("grpc.canceled");
30-
private static final AttributeKey<Long> GRPC_MESSAGES_RECEIVED =
31-
AttributeKey.longKey("grpc.messages.received");
32-
private static final AttributeKey<Long> GRPC_MESSAGES_SENT =
33-
AttributeKey.longKey("grpc.messages.sent");
30+
private static final AttributeKey<Long> GRPC_RECEIVED_MESSAGE_COUNT =
31+
AttributeKey.longKey("grpc.received.message_count");
32+
private static final AttributeKey<Long> GRPC_SENT_MESSAGE_COUNT =
33+
AttributeKey.longKey("grpc.sent.message_count");
3434
// copied from MessageIncubatingAttributes
3535
private static final AttributeKey<Long> MESSAGE_ID = AttributeKey.longKey("message.id");
3636
private static final AttributeKey<String> MESSAGE_TYPE = AttributeKey.stringKey("message.type");
@@ -157,9 +157,9 @@ private void end(Context context, GrpcRequest request, Status response, Throwabl
157157
if (captureExperimentalSpanAttributes) {
158158
Span span = Span.fromContext(context);
159159
span.setAttribute(
160-
GRPC_MESSAGES_RECEIVED, RECEIVED_MESSAGE_ID_UPDATER.get(TracingServerCall.this));
160+
GRPC_RECEIVED_MESSAGE_COUNT, RECEIVED_MESSAGE_ID_UPDATER.get(TracingServerCall.this));
161161
span.setAttribute(
162-
GRPC_MESSAGES_SENT, SENT_MESSAGE_ID_UPDATER.get(TracingServerCall.this));
162+
GRPC_SENT_MESSAGE_COUNT, SENT_MESSAGE_ID_UPDATER.get(TracingServerCall.this));
163163
if (Status.CANCELLED.equals(status)) {
164164
span.setAttribute(GRPC_CANCELED, true);
165165
}

0 commit comments

Comments
 (0)