Skip to content

Commit 8b61bc8

Browse files
committed
Fix for #4965,
Added InnerExceptionTypie and ParameterSetName to the telemetry emitted. Please enter the commit message for your changes. Lines starting
1 parent a854558 commit 8b61bc8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Common/Commands.Common/MetricHelper.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ private void LogExceptionEvent(AzurePSQoSEvent qos)
226226
eventProperties.Add("Message", "Message removed due to PII.");
227227
eventProperties.Add("StackTrace", qos.Exception.StackTrace);
228228
eventProperties.Add("ExceptionType", qos.Exception.GetType().ToString());
229+
if (qos.Exception.InnerException != null)
230+
{
231+
eventProperties.Add("InnerExceptionType", qos.Exception.InnerException.GetType().ToString());
232+
}
229233
client.TrackException(null, eventProperties, eventMetrics);
230234
}
231235
}
@@ -266,6 +270,7 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
266270
eventProperties.Add("HashMacAddress", HashMacAddress);
267271
eventProperties.Add("PowerShellVersion", PSVersion);
268272
eventProperties.Add("Version", AzurePowerShell.AssemblyVersion);
273+
eventProperties.Add("CommandParameterSetName", qos.ParameterSetName);
269274
if (qos.InputFromPipeline != null)
270275
{
271276
eventProperties.Add("InputFromPipeline", qos.InputFromPipeline.Value.ToString());
@@ -371,6 +376,7 @@ public class AzurePSQoSEvent
371376
public string Uid { get; set; }
372377
public string ClientRequestId { get; set; }
373378
public string SessionId { get; set; }
379+
public string ParameterSetName { get; set; }
374380
public Dictionary<string, string> CustomProperties { get; private set; }
375381

376382
public AzurePSQoSEvent()

src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ protected override void InitializeQosEvent()
214214
s => string.Format(CultureInfo.InvariantCulture, "-{0} ***", s)));
215215
}
216216

217+
if (!string.IsNullOrWhiteSpace(this.ParameterSetName))
218+
{
219+
_qosEvent.ParameterSetName = this.ParameterSetName;
220+
}
221+
217222
IAzureContext context;
218223
if (TryGetDefaultContext(out context)
219224
&& context.Account != null

0 commit comments

Comments
 (0)