@@ -38,12 +38,31 @@ internal enum TelemetryType
38
38
/// </summary>
39
39
WinCompatModuleLoad ,
40
40
41
+ /// <summary>
42
+ /// Send telemetry for experimental module feature deactivation.
43
+ /// All experimental engine features will be have telemetry.
44
+ /// </summary>
45
+ ExperimentalEngineFeatureDeactivation ,
46
+
41
47
/// <summary>
42
48
/// Send telemetry for experimental module feature activation.
43
49
/// All experimental engine features will be have telemetry.
44
50
/// </summary>
45
51
ExperimentalEngineFeatureActivation ,
46
52
53
+ /// <summary>
54
+ /// Send telemetry for an experimental feature when use.
55
+ /// </summary>
56
+ ExperimentalFeatureUse ,
57
+
58
+ /// <summary>
59
+ /// Send telemetry for experimental module feature deactivation.
60
+ /// Experimental module features will send telemetry based on the module it is in.
61
+ /// If we send telemetry for the module, we will also do so for any experimental feature
62
+ /// in that module.
63
+ /// </summary>
64
+ ExperimentalModuleFeatureDeactivation ,
65
+
47
66
/// <summary>
48
67
/// Send telemetry for experimental module feature activation.
49
68
/// Experimental module features will send telemetry based on the module it is in.
@@ -126,7 +145,7 @@ public static class ApplicationInsightsTelemetry
126
145
private static readonly HashSet < string > s_knownModules ;
127
146
128
147
/// <summary>Gets a value indicating whether telemetry can be sent.</summary>
129
- public static bool CanSendTelemetry { get ; private set ; }
148
+ public static bool CanSendTelemetry { get ; private set ; } = false ;
130
149
131
150
/// <summary>
132
151
/// Initializes static members of the <see cref="ApplicationInsightsTelemetry"/> class.
@@ -703,9 +722,12 @@ internal static void SendTelemetryMetric(TelemetryType metricId, string data)
703
722
case TelemetryType . PowerShellCreate :
704
723
case TelemetryType . RemoteSessionOpen :
705
724
case TelemetryType . ExperimentalEngineFeatureActivation :
725
+ case TelemetryType . ExperimentalEngineFeatureDeactivation :
726
+ case TelemetryType . ExperimentalFeatureUse :
706
727
s_telemetryClient . GetMetric ( metricName , "uuid" , "SessionId" , "Detail" ) . TrackValue ( metricValue : 1.0 , s_uniqueUserIdentifier , s_sessionId , data ) ;
707
728
break ;
708
729
case TelemetryType . ExperimentalModuleFeatureActivation :
730
+ case TelemetryType . ExperimentalModuleFeatureDeactivation :
709
731
string experimentalFeatureName = GetExperimentalFeatureName ( data ) ;
710
732
s_telemetryClient . GetMetric ( metricName , "uuid" , "SessionId" , "Detail" ) . TrackValue ( metricValue : 1.0 , s_uniqueUserIdentifier , s_sessionId , experimentalFeatureName ) ;
711
733
break ;
@@ -718,6 +740,21 @@ internal static void SendTelemetryMetric(TelemetryType metricId, string data)
718
740
}
719
741
}
720
742
743
+ /// <summary>
744
+ /// Send additional information about an experimental feature as it is used.
745
+ /// </summary>
746
+ /// <param name="featureName">The name of the experimental feature.</param>
747
+ /// <param name="detail">The details about the experimental feature use.</param>
748
+ internal static void SendExperimentalUseData ( string featureName , string detail )
749
+ {
750
+ if ( ! CanSendTelemetry )
751
+ {
752
+ return ;
753
+ }
754
+
755
+ ApplicationInsightsTelemetry . SendTelemetryMetric ( TelemetryType . ExperimentalFeatureUse , string . Join ( ":" , featureName , detail ) ) ;
756
+ }
757
+
721
758
// Get the experimental feature name. If we can report it, we'll return the name of the feature, otherwise, we'll return "anonymous"
722
759
private static string GetExperimentalFeatureName ( string featureNameToValidate )
723
760
{
@@ -779,6 +816,7 @@ internal static void SendPSCoreStartupTelemetry(string mode, double parametersUs
779
816
properties . Add ( "UUID" , s_uniqueUserIdentifier ) ;
780
817
properties . Add ( "GitCommitID" , PSVersionInfo . GitCommitId ) ;
781
818
properties . Add ( "OSDescription" , RuntimeInformation . OSDescription ) ;
819
+ properties . Add ( "RuntimeIdentifier" , RuntimeInformation . RuntimeIdentifier ) ;
782
820
properties . Add ( "OSChannel" , string . IsNullOrEmpty ( channel ) ? "unknown" : channel ) ;
783
821
properties . Add ( "StartMode" , string . IsNullOrEmpty ( mode ) ? "unknown" : mode ) ;
784
822
0 commit comments