Skip to content

Commit feb59ca

Browse files
authored
[9.0.1xx] Proto/enable buildcheck telemetry rc2 (#43431)
2 parents 795af9f + 591e969 commit feb59ca

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Cli/dotnet/commands/dotnet-msbuild/MSBuildLogger.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ public sealed class MSBuildLogger : INodeLogger
1818
internal const string TargetFrameworkTelemetryEventName = "targetframeworkeval";
1919
internal const string BuildTelemetryEventName = "build";
2020
internal const string LoggingConfigurationTelemetryEventName = "loggingConfiguration";
21+
internal const string BuildcheckAcquisitionFailureEventName = "buildcheck/acquisitionfailure";
22+
internal const string BuildcheckRunEventName = "buildcheck/run";
23+
internal const string BuildcheckRuleStatsEventName = "buildcheck/rule";
2124

2225
internal const string SdkTaskBaseCatchExceptionTelemetryEventName = "taskBaseCatchException";
2326
internal const string PublishPropertiesTelemetryEventName = "PublishProperties";
@@ -138,6 +141,21 @@ internal static void FormatAndSend(ITelemetry telemetry, TelemetryEventArgs args
138141
toBeHashed: Array.Empty<string>(),
139142
toBeMeasured: new[] { "FileLoggersCount" });
140143
break;
144+
case BuildcheckAcquisitionFailureEventName:
145+
TrackEvent(telemetry, $"msbuild/{BuildcheckAcquisitionFailureEventName}", args.Properties,
146+
toBeHashed: new[] { "AssemblyName", "ExceptionType", "ExceptionMessage" },
147+
toBeMeasured: Array.Empty<string>());
148+
break;
149+
case BuildcheckRunEventName:
150+
TrackEvent(telemetry, $"msbuild/{BuildcheckRunEventName}", args.Properties,
151+
toBeHashed: Array.Empty<string>(),
152+
toBeMeasured: new[] { "TotalRuntimeInMilliseconds" });
153+
break;
154+
case BuildcheckRuleStatsEventName:
155+
TrackEvent(telemetry, $"msbuild/{BuildcheckRuleStatsEventName}", args.Properties,
156+
toBeHashed: new[] { "RuleId", "CheckFriendlyName" },
157+
toBeMeasured: new[] { "TotalRuntimeInMilliseconds" });
158+
break;
141159
// Pass through events that don't need special handling
142160
case SdkTaskBaseCatchExceptionTelemetryEventName:
143161
case PublishPropertiesTelemetryEventName:

0 commit comments

Comments
 (0)