MassTransit.OpenTracing
MassTransit.OpenTracing copied to clipboard
ConsumeFilter/Operation name
I had to change the logic that determines the operation name to the following, though I'm not sure if it's correct and I'm not happy with just FirstOrDefault(). But since the change Jaeger lists the operation name correctly.
var operationName = $"Consuming Message: {context.SupportedMessageTypes.FirstOrDefault()?.Replace("urn:message:", string.Empty) ?? context.DestinationAddress.GetExchangeName()}";
The reason is that the context.DestinationAddress.GetExchangeName() does not often render into a correct exchange name/message contract with full namespace. Might be due to the message contracts inheritance?
- could you please advise why my change is needed?
- would you consider fixing the operation name determination in your code (and updating nuget package?)
Hi michalpenka,
Thanks for the feedback.
Can you please give me an example of context.DestinationAddress.GetExchangeName() for when it 'does not render into a correct exchange name/message contract with full namespace'...
perhaps it's something in my UriExtensions.GetExchangeName
extension method:
public static string GetExchangeName(this Uri value)
{
var exchange = value.LocalPath;
var messageType = exchange.Substring(exchange.LastIndexOf('/') + 1);
return messageType;
}
kind regards, Ryan.