[QUERY] Distributed Tracing in EventHub - example?
See original GitHub issueQuery/Question Now that EventHub supports distributed tracing and submits the Diagnostics-id in a similar way to what Service Bus already did, do you have a corresponding example how to use that ID in the processor? This show it for Service Bus messages: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-end-to-end-tracing#trace-message-processing
private readonly TelemetryClient telemetryClient;
async Task ProcessAsync(Message message)
{
var activity = message.ExtractActivity();
// If you are using Microsoft.ApplicationInsights package version 2.6-beta or higher, you should call StartOperation<RequestTelemetry>(activity) instead
using (var operation = telemetryClient.StartOperation<RequestTelemetry>("Process", activity.RootId, activity.ParentId))
{
telemetryClient.TrackTrace("Received message");
try
{
// process message
}
catch (Exception ex)
{
telemetryClient.TrackException(ex);
operation.Telemetry.Success = false;
throw;
}
telemetryClient.TrackTrace("Done");
}
}
Environment:
- Name and version of the Library package used:
- Azure.Messaging.EventHubs.Processor 5.2.0-preview.1
- Microsoft.ApplicationInsights 2.15.0-beta2
- Hosting platform or OS and .NET runtime version (
dotnet --info
output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8] .NET Core 3.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Observability for Event Stream Processing with Azure ...
The biggest takeaway for us is that Azure Event Hubs works well with Azure Functions in terms of distributed tracing. With distributed tracing...
Read more >App Insights query for Service Bus
Once the Service Bus published the message and has logged tracing events, logs in Application Insights can be queried using the Kusto query...
Read more >Query distributed trace data
You can query your distributed tracing data in several ways: The search bar at top of the distributed tracing UI; NRQL query; NerdGraph...
Read more >Distributed Tracing
New! Enjoy distributed tracing using our updated Tracing function. Optimize performance, troubleshoot bottlenecks, monitor latency, and link ...
Read more >Azure Event Hubs integration | Grafana Cloud documentation
Under “Destination details”, select “Stream to an event hub” as the destination and choose the appropriate options. Configure any advanced settings if needed....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, this takes a while. We are working on OpenTelemetry instrumentation story across all our libraries tat would include the extraction part. I don’t have exact ETA for it because OT messaging spec is still in preview.
No, the approach in sebader’s comment explicitly uses AppInsights. You are correct that to get OpenTelemetry integration you would have to use ActivitySource to start the activity.
Yes.
Hi @sebader. To be transparent, I’m not sure what the best path would be to help get you an authoritative answer to this. We may need to ask a couple of folks for help before finding the right person. Please bear with us.
Diagnostics for the new generation of Azure SDKs are intended to be a consistent and drive from a common initiative around OpenTelemetry. Since a good deal of the efforts here were coordinated through Azure.Core, I’m going to start by asking @pakrym for his thoughts or help routing to someone better able to assist.
In the meantime, I wanted to call your attention to the Distributed tracing section of the
Azure.Core
diagnostics sample. The Application Insights and OpenTelemetry resources linked there may help.