Skip to content

otel tracing: fix span names #11974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ private void recordOutboundMessageSentEvent(Span span,
if (optionalWireSize != -1 && optionalWireSize != optionalUncompressedSize) {
attributesBuilder.put("message-size-compressed", optionalWireSize);
}
span.addEvent("Outbound message sent", attributesBuilder.build());
span.addEvent("Outbound message", attributesBuilder.build());
}

private void recordInboundCompressedMessage(Span span, int seqNo, long optionalWireSize) {
Expand All @@ -460,7 +460,7 @@ private void recordInboundMessageSize(Span span, int seqNo, long bytes) {
AttributesBuilder attributesBuilder = io.opentelemetry.api.common.Attributes.builder();
attributesBuilder.put("sequence-number", seqNo);
attributesBuilder.put("message-size", bytes);
span.addEvent("Inbound message received", attributesBuilder.build());
span.addEvent("Inbound message", attributesBuilder.build());
}

private String generateErrorStatusDescription(io.grpc.Status status) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void clientBasicTracingMocking() {
List<String> events = eventNameCaptor.getAllValues();
List<io.opentelemetry.api.common.Attributes> attributes = attributesCaptor.getAllValues();
assertEquals(
"Outbound message sent" ,
"Outbound message" ,
events.get(0));
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand All @@ -241,7 +241,7 @@ public void clientBasicTracingMocking() {
attributes.get(0));

assertEquals(
"Outbound message sent" ,
"Outbound message" ,
events.get(1));
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand Down Expand Up @@ -313,7 +313,7 @@ public void clientBasicTracingRule() {
assertTrue(clientSpanEvents.get(0).getAttributes().isEmpty());

assertEquals(
"Inbound message received" ,
"Inbound message" ,
clientSpanEvents.get(1).getName());
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand All @@ -323,7 +323,7 @@ public void clientBasicTracingRule() {
clientSpanEvents.get(1).getAttributes());

assertEquals(
"Inbound message received" ,
"Inbound message" ,
clientSpanEvents.get(2).getName());
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand All @@ -342,7 +342,7 @@ public void clientBasicTracingRule() {
assertTrue(clientSpanEvents.get(0).getAttributes().isEmpty());

assertEquals(
"Outbound message sent" ,
"Outbound message" ,
attemptSpanEvents.get(1).getName());
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand All @@ -352,7 +352,7 @@ public void clientBasicTracingRule() {
attemptSpanEvents.get(1).getAttributes());

assertEquals(
"Outbound message sent" ,
"Outbound message" ,
attemptSpanEvents.get(2).getName());
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand Down Expand Up @@ -518,7 +518,7 @@ public void serverBasicTracingNoHeaders() {
List<EventData> events = spans.get(0).getEvents();
assertEquals(events.size(), 4);
assertEquals(
"Outbound message sent" ,
"Outbound message" ,
events.get(0).getName());
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand All @@ -529,7 +529,7 @@ public void serverBasicTracingNoHeaders() {
events.get(0).getAttributes());

assertEquals(
"Outbound message sent" ,
"Outbound message" ,
events.get(1).getName());
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand All @@ -549,7 +549,7 @@ public void serverBasicTracingNoHeaders() {
events.get(2).getAttributes());

assertEquals(
"Inbound message received" ,
"Inbound message" ,
events.get(3).getName());
assertEquals(
io.opentelemetry.api.common.Attributes.builder()
Expand Down