Skip to content

Commit

Permalink
use "message_bus.destination" tag for both, producer and consumer (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
zserge authored Jan 31, 2020
1 parent 837b3fc commit 7c67ce7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public <K, V> void onSend(ProducerRecord<K, V> record, Span span) {

public <K, V> void onResponse(ConsumerRecord<K, V> record, Span span) {
setCommonTags(span);
Tags.MESSAGE_BUS_DESTINATION.set(span, record.topic());
span.setTag("partition", record.partition());
span.setTag("topic", record.topic());
span.setTag("offset", record.offset());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ private void checkSpans(List<MockSpan> mockSpans) {
assertEquals(0, mockSpan.tags().get("partition"));
long offset = (Long) mockSpan.tags().get("offset");
assertTrue(offset >= 0L);
assertEquals("messages", mockSpan.tags().get("topic"));
assertEquals("messages", mockSpan.tags().get(Tags.MESSAGE_BUS_DESTINATION.getKey()));
}
assertEquals(StandardSpanDecorator.COMPONENT_NAME,
mockSpan.tags().get(Tags.COMPONENT.getKey()));
Expand Down Expand Up @@ -764,4 +764,4 @@ private List<MockSpan> getByOperationNameAll(List<MockSpan> spans, String operat
return found;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void checkSpans(List<MockSpan> mockSpans) {
assertEquals(0, mockSpan.tags().get("partition"));
long offset = (Long) mockSpan.tags().get("offset");
assertTrue(offset == 0L || offset == 1L || offset == 2L);
String topicName = (String) mockSpan.tags().get("topic");
String topicName = (String) mockSpan.tags().get(Tags.MESSAGE_BUS_DESTINATION.getKey());
assertTrue(topicName.equals("stream-out") || topicName.equals("stream-test"));
}
assertEquals("java-kafka", mockSpan.tags().get(Tags.COMPONENT.getKey()));
Expand All @@ -132,4 +132,4 @@ private void checkSpans(List<MockSpan> mockSpans) {
private Callable<Integer> reportedSpansSize() {
return () -> mockTracer.finishedSpans().size();
}
}
}

0 comments on commit 7c67ce7

Please sign in to comment.