'Grouping Custom Events/Exceptions to a Request's End-to-End Transaction in Azure Application Insights

I am using Azure Application Insights for logging and tracking event flows for my Azure Function. I was wondering if there's a way to group Custom Events and manually-logged Exceptions (via TrackException()) to the end-to-end transaction details of a particular request in the Transaction Search.

I'm using the following sample code:

using (var operation = telemetryClient.StartOperation<RequestTelemetry>("operationName"))
{
    telemetryClient.TrackEvent("test event");
    telemetryClient.TrackException(new Exception("test exception"));
}

And getting the following logs (newest first):

enter image description here

And the end-to-end transaction detail for the request looks like this (no child event nor exception) enter image description here

I would just like to confirm if there's a way to get something similar to this: enter image description here

Thanks in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source