You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi:
I followed the instructions hereApp insights to write custom telemetry
But I see that the trace not work as the document said that share the same operation id
Along with setting an operation context, StartOperation creates a telemetry item of the type that you specify. It sends the telemetry item when you dispose of the operation or if you explicitly call StopOperation. If you use RequestTelemetry as the telemetry type, its duration is set to the timed interval between start and stop.
Telemetry items reported within a scope of operation become children of such an operation. Operation contexts could be nested.
My test project is .net4.7.2 and install the appinsights nuget
How do I correlate the child trace with parent request correctly? Thanks
// Establish an operation context and associated telemetry item:
using (var operation = telemetryClient.StartOperation<RequestTelemetry>("operationName"))
{
// Telemetry sent in here will use the same operation ID.
telemetryClient.TrackTrace("test"); // or other Track* calls
// Set properties of containing telemetry item--for example:
operation.Telemetry.ResponseCode = "200";
// Optional: explicitly send telemetry item:
telemetryClient.StopOperation(operation);
operation.Dispose();
telemetryClient.Flush();
} // When operation is disposed, telemetry item is sent.
The text was updated successfully, but these errors were encountered:
Hi:
I followed the instructions hereApp insights to write custom telemetry
But I see that the trace not work as the document said that share the same operation id
My test project is .net4.7.2 and install the appinsights nuget
How do I correlate the child trace with parent request correctly? Thanks
The text was updated successfully, but these errors were encountered: