Skip to content

Commit

Permalink
Add exception type to telemetry if execution is failed (#204)
Browse files Browse the repository at this point in the history
* Add exception type to telemetry if execution is failed

* Sort using
  • Loading branch information
dingmeng-xue authored Aug 14, 2020
1 parent 8a62a28 commit 229b9f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Common/MetricHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Management.Automation.Host;
using System.Net.Http.Headers;
using System.Security.Cryptography;
using System.Text;

Expand Down Expand Up @@ -285,6 +284,11 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
eventProperties.Add("subscription-id", qos.SubscriptionId);
eventProperties.Add("tenant-id", qos.TenantId);

if(qos.Exception != null)
{
eventProperties.Add("exception-type", qos.Exception.GetType().ToString());
}

if (qos.InputFromPipeline != null)
{
eventProperties.Add("InputFromPipeline", qos.InputFromPipeline.Value.ToString());
Expand Down

0 comments on commit 229b9f4

Please sign in to comment.