@@ -226,6 +226,16 @@ private void LogExceptionEvent(AzurePSQoSEvent qos)
226
226
eventProperties . Add ( "Message" , "Message removed due to PII." ) ;
227
227
eventProperties . Add ( "StackTrace" , qos . Exception . StackTrace ) ;
228
228
eventProperties . Add ( "ExceptionType" , qos . Exception . GetType ( ) . ToString ( ) ) ;
229
+ Exception innerEx = qos . Exception . InnerException ;
230
+ int exceptionCount = 0 ;
231
+ //keep goin till we get to the last inner exception
232
+ while ( innerEx != null )
233
+ {
234
+ //Increment the inner exception count so that we can tell which is the outermost
235
+ //and which the innermost
236
+ eventProperties . Add ( "InnerExceptionType-" + exceptionCount ++ , innerEx . GetType ( ) . ToString ( ) ) ;
237
+ innerEx = innerEx . InnerException ;
238
+ }
229
239
client . TrackException ( null , eventProperties , eventMetrics ) ;
230
240
}
231
241
}
@@ -266,6 +276,9 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
266
276
eventProperties . Add ( "HashMacAddress" , HashMacAddress ) ;
267
277
eventProperties . Add ( "PowerShellVersion" , PSVersion ) ;
268
278
eventProperties . Add ( "Version" , AzurePowerShell . AssemblyVersion ) ;
279
+ eventProperties . Add ( "CommandParameterSetName" , qos . ParameterSetName ) ;
280
+ eventProperties . Add ( "CommandInvocationName" , qos . InvocationName ) ;
281
+
269
282
if ( qos . InputFromPipeline != null )
270
283
{
271
284
eventProperties . Add ( "InputFromPipeline" , qos . InputFromPipeline . Value . ToString ( ) ) ;
@@ -371,6 +384,8 @@ public class AzurePSQoSEvent
371
384
public string Uid { get ; set ; }
372
385
public string ClientRequestId { get ; set ; }
373
386
public string SessionId { get ; set ; }
387
+ public string ParameterSetName { get ; set ; }
388
+ public string InvocationName { get ; set ; }
374
389
public Dictionary < string , string > CustomProperties { get ; private set ; }
375
390
376
391
public AzurePSQoSEvent ( )
0 commit comments