Correlating messages accross services in Application Insights

157 views
Skip to first unread message

Reng van Oord

unread,
Jan 17, 2020, 7:54:02 AM1/17/20
to masstransit-discuss
Hi!

In MassTransit 5.5 it was possible to correlate message tracing in Application Insights so that messages sent between services were linked together as dependencies using code similar to the code below. Using these extension methods, it was possible to follow a message flow between multiple services.

cfg.UseApplicationInsightsOnConsume(telemetry, (requestTelemetry, consumeContext) =>
{
    var source = consumeContext.Headers.Get<string>("TelemetrySourceId");
    requestTelemetry.Telemetry.Source = source;
});

cfg.UseApplicationInsightsOnPublish(telemetry, (dependencyTelemetry, publishContext) =>
{
    publishContext.Headers.Set("TelemetrySourceId", "cid-v1:" + applicationId);
    dependencyTelemetry.Telemetry.Target = publishContext.DestinationAddress.ToString();
});

cfg.UseApplicationInsightsOnSend(telemetry, (dependencyTelemetry, sendContext) =>
{
    sendContext.Headers.Set("TelemetrySourceId", "cid-v1:" + applicationId);
    dependencyTelemetry.Telemetry.Target = sendContext.DestinationAddress.ToString(); // Options.RabbitMqHost;
 });


With MassTransit 6, these extension methods have been removed and tracing now uses DiagnosticSource activities. Using the standard configuration, dependencies between event publishers and consumers are no longer visible in Application Insights.

Is there a way to register dependencies in Application Insights with MassTransit 6 and DiagnosticSource activities?



Chris Patterson

unread,
Jan 17, 2020, 8:10:55 AM1/17/20
to masstrans...@googlegroups.com

There are tweaks in the _develop packages to make everything line up better in Application Insights, should be part of a 6.0.2 release at some point.


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/58a493e8-74ce-4c50-af03-0f6c5bc8279b%40googlegroups.com.

Reng van Oord

unread,
Jan 17, 2020, 9:13:10 AM1/17/20
to masstrans...@googlegroups.com
Thanks for your quick response! 
I updated to 6.0.2 develop and tracing seemed to work exactly as expected!

Reply all
Reply to author
Forward
0 new messages