35
35
using System . Threading . Tasks ;
36
36
using System . ComponentModel ;
37
37
using Microsoft . WindowsAzure . Commands . Common . Sanitizer ;
38
+ using Microsoft . Azure . Commands . Common . Authentication . Abstractions . Models ;
38
39
39
40
namespace Microsoft . WindowsAzure . Commands . Common
40
41
{
@@ -451,6 +452,7 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
451
452
}
452
453
}
453
454
455
+ PopulateConfigMetricsFromQos ( qos , eventProperties ) ;
454
456
PopulateSanitizerPropertiesFromQos ( qos , eventProperties ) ;
455
457
456
458
if ( qos . InputFromPipeline != null )
@@ -500,6 +502,17 @@ private void PopulateSanitizerPropertiesFromQos(AzurePSQoSEvent qos, IDictionary
500
502
}
501
503
}
502
504
505
+ private void PopulateConfigMetricsFromQos ( AzurePSQoSEvent qos , IDictionary < string , string > eventProperties )
506
+ {
507
+ if ( qos ? . ConfigMetrics != null )
508
+ {
509
+ foreach ( var configMetric in qos . ConfigMetrics )
510
+ {
511
+ eventProperties [ configMetric . ConfigKey ] = configMetric . ConfigValue ;
512
+ }
513
+ }
514
+ }
515
+
503
516
private static string [ ] exceptionTrackAcceptModuleList = { "Az.Accounts" , "Az.Compute" , "Az.AKS" , "Az.ContainerRegistry" } ;
504
517
private static string [ ] exceptionTrackAcceptCmdletList = { "Get-AzKeyVaultSecret" , "Get-AzKeyVaultCert" } ;
505
518
@@ -656,7 +669,11 @@ public class AzurePSQoSEvent
656
669
657
670
public string ParameterSetName { get ; set ; }
658
671
public string InvocationName { get ; set ; }
672
+
673
+ public List < ConfigMetrics > ConfigMetrics { get ; private set ; }
674
+
659
675
public Dictionary < string , string > CustomProperties { get ; private set ; }
676
+
660
677
private static bool ShowTelemetry = string . Equals ( bool . TrueString , Environment . GetEnvironmentVariable ( "AZUREPS_DEBUG_SHOW_TELEMETRY" ) , StringComparison . OrdinalIgnoreCase ) ;
661
678
662
679
public SanitizerTelemetry SanitizerInfo { get ; set ; }
@@ -666,6 +683,7 @@ public AzurePSQoSEvent()
666
683
StartTime = DateTimeOffset . Now ;
667
684
_timer = new Stopwatch ( ) ;
668
685
_timer . Start ( ) ;
686
+ ConfigMetrics = new List < ConfigMetrics > ( ) ;
669
687
CustomProperties = new Dictionary < string , string > ( ) ;
670
688
}
671
689
0 commit comments