Skip to content

Commit

Permalink
Fixing formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
stebet committed Mar 14, 2023
1 parent c007da0 commit dd8db20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions projects/RabbitMQ.Client/client/impl/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ internal void Write(ReadOnlyMemory<byte> memory)
{
activity.SetTag("net.sock.family", "inet6");
}

activity
.SetTag("net.sock.peer.addr", ipEndpoint.Address.ToString())
.SetTag("net.peer.port", ipEndpoint.Port.ToString());
Expand All @@ -427,7 +427,7 @@ internal void Write(ReadOnlyMemory<byte> memory)
{
activity.SetTag("net.sock.family", "inet6");
}

activity
.SetTag("net.sock.host.addr", localEndpoint.Address.ToString())
.SetTag("net.host.port", localEndpoint.Port.ToString());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

using RabbitMQ.Client.Events;
using RabbitMQ.Client.Framing.Impl;

Expand Down Expand Up @@ -95,7 +92,7 @@ internal static Activity Process(BasicDeliverEventArgs deliverEventArgs)
Activity.Current?.SetBaggage(item.Key, item.Value);
}
}

PopulateMessagingTags("process", deliverEventArgs.RoutingKey, deliverEventArgs.Exchange, deliverEventArgs.DeliveryTag, deliverEventArgs.BasicProperties, deliverEventArgs.Body.Length, activity);
}

Expand Down Expand Up @@ -128,7 +125,7 @@ private static Activity StartRabbitMQActivity(string name, ActivityKind kind, Ac

private static void PopulateMessagingTags(string operation, string routingKey, string exchange, ulong deliveryTag, IReadOnlyBasicProperties readOnlyBasicProperties, int bodySize, Activity activity)
{

activity
.SetTag(MessagingOperation, operation)
.SetTag(MessagingDestination, string.IsNullOrEmpty(exchange) ? "amq.default" : exchange)
Expand All @@ -149,7 +146,7 @@ private static void PopulateMessagingTags(string operation, string routingKey, s
}
}
}

private static void ExtractTraceIdAndState(object carrier, string name, out string value, out IEnumerable<string> values)
{
if (carrier is IReadOnlyBasicProperties props && props.Headers is not null && props.Headers.TryGetValue(name, out object propsVal) && propsVal is byte[] bytes)
Expand Down
2 changes: 1 addition & 1 deletion projects/Unit/ActivitySource/TestActivitySource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void AssertIntTagGreaterThanZero(Activity activity, string name)
AssertStringTagNotNullOrEmpty(sendActivity, "net.sock.host.addr");
AssertIntTagGreaterThanZero(sendActivity, "net.host.port");
AssertStringTagEquals(sendActivity, "net.transport", "ip_tcp");
AssertStringTagEquals(sendActivity, RabbitMQActivitySource.MessagingSystem, "rabbitmq");
AssertStringTagEquals(sendActivity, RabbitMQActivitySource.MessagingSystem, "rabbitmq");
AssertStringTagEquals(sendActivity, RabbitMQActivitySource.ProtocolName, "amqp");
AssertStringTagEquals(sendActivity, RabbitMQActivitySource.ProtocolVersion, "0.9.1");
AssertStringTagEquals(sendActivity, RabbitMQActivitySource.MessagingDestination, "amq.default");
Expand Down

0 comments on commit dd8db20

Please sign in to comment.