Hello @Mahesh Gupta ,
The property HandledAt still works but it is deprecated, so I would not suggest you to use that anymore. If you set that property, the resulting exception in app insights would have a custom dimension like below:
You can achieve the same by setting properties of the exception telemetry in code in either of the overloads of TrackException method of TelemetryClient:
- Setting properties of exception telemetry:
var telemetry = new ExceptionTelemetry(exception); telemetry.Properties["handledAt"] = "UserCode"; // or any string telemetryClient.TrackException(telemetry);
Or 2. The second overload of TrackException accepts properties as a param:
var properties = new Dictionary<string, string>();
properties["handledAt"] = "UserCode"; // or any string
telemetryClient.TrackException(exception, properties, metrics);
Note Custom dimension is a very helpful way to set free form properties of telemetry from code. So, you can set whatever you want. The above handledAt is just to solve your problem.
I am not too sure about the version in which handledAt got deprecated, it was way back in 2017-ish.