Skip to content

Commit

Permalink
Add protocol name and version tags on deliver operation
Browse files Browse the repository at this point in the history
References #952
  • Loading branch information
acogoluegnes committed Jul 18, 2023
1 parent 20d7e44 commit 014dc65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ private String source(String destination) {
public KeyValues getLowCardinalityKeyValues(DeliverContext context) {
return KeyValues.of(
LowCardinalityTags.MESSAGING_OPERATION.withValue(this.operation),
LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq"));
LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq"),
LowCardinalityTags.NET_PROTOCOL_NAME.withValue("amqp"),
LowCardinalityTags.NET_PROTOCOL_VERSION.withValue("0.9.1"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ public SampleTestRunnerConsumer yourCode() {
.hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue")
.hasTag("messaging.destination.name", "amq.default")
.hasTag("messaging.source.name", "metrics.queue")
.hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length));
.hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length))
.hasTag("net.protocol.name", "amqp")
.hasTag("net.protocol.version", "0.9.1");
waitAtMost(
() ->
getMeterRegistry().find("rabbitmq.publish").timer() != null
Expand Down Expand Up @@ -239,7 +241,9 @@ public SampleTestRunnerConsumer yourCode() {
.hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue")
.hasTag("messaging.destination.name", "amq.default")
.hasTag("messaging.source.name", "metrics.queue")
.hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length));
.hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length))
.hasTag("net.protocol.name", "amqp")
.hasTag("net.protocol.version", "0.9.1");
List<FinishedSpan> pollingSpans =
spans.stream()
.filter(f -> f.size() == 1)
Expand Down Expand Up @@ -323,7 +327,9 @@ public SampleTestRunnerConsumer yourCode() {
.hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue")
.hasTag("messaging.destination.name", "amq.default")
.hasTag("messaging.source.name", "metrics.queue")
.hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length));
.hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length))
.hasTag("net.protocol.name", "amqp")
.hasTag("net.protocol.version", "0.9.1");
List<FinishedSpan> pollingSpans =
spans.stream()
.filter(f -> f.size() == 1)
Expand Down

0 comments on commit 014dc65

Please sign in to comment.