Skip to content

Commit

Permalink
Use collection expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroservienti committed Jun 20, 2024
1 parent b9415e1 commit 4b25647
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/NServiceBus.Core/OpenTelemetry/Metrics/MeterTags.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
namespace NServiceBus;

using System;
using System.Collections.Generic;
using System.Diagnostics;

static class MeterTags
Expand All @@ -14,11 +12,11 @@ static class MeterTags
public const string ExecutionResult = "execution.result";
public const string ErrorType = "error.type";

public static TagList CommonMessagingMetricTags(string queueName, string discriminator, string messageType)
{
return new TagList(new KeyValuePair<string, object>[]
{
new(QueueName, queueName ?? ""), new(EndpointDiscriminator, discriminator ?? ""), new(MessageType, messageType ?? "")
}.AsSpan());
}
public static TagList CommonMessagingMetricTags(string queueName, string discriminator, string messageType) =>
new(
[
new(QueueName, queueName ?? ""),
new(EndpointDiscriminator, discriminator ?? ""),
new(MessageType, messageType ?? "")
]);
}

0 comments on commit 4b25647

Please sign in to comment.