Skip to content

Commit 8f475c6

Browse files
authored
Document msbuild telemetry datapoints (#10800)
* Document msbuild telemetry datapoints * Mention VS official doc * Update CollectedTelemetry.md
1 parent e3bd72b commit 8f475c6

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# MSBuild Telemetry
2+
3+
MSBuild emits and collects telemetry to guide decisions on modernization and optimization investments. Currently the MSBuild collects telemetry only when run from SDK host (mostly the `dotnet build` and `dotnet msbuild` commands). For more details please refer to [the official SDK telemetry documentation](https://learn.microsoft.com/dotnet/core/tools/telemetry).
4+
5+
Visual Studio collects some build related telemetry - but that is not leveraging any MSBuild instrumentation, but rather information about count and duration of MSBuild API invocations from the caller point of view. For general information about telemetry being collected by Visual Studio Family of products and regulations compliance please refer to [the official documentation](https://learn.microsoft.com/compliance/regulatory/gdpr-dsr-visual-studio-family).
6+
7+
## Type of data collected
8+
9+
To tailor modernization and performance optimization investments we need to contain *anonymized* **Usage Data**. Those reflect type of features being used and execution time being spent in them.
10+
11+
## Opting out
12+
13+
MSBuild telemetry collection (that is turned on by default), can be opted out - same as .NET SDK telemetry in general - via setting `DOTNET_CLI_TELEMETRY_OPTOUT` environment variable to `1` or `true`.
14+
15+
## Datapoints overview
16+
17+
### Logging Configuration
18+
19+
Expressed and collected via [LoggingConfigurationTelemetry type](https://github.com/dotnet/msbuild/blob/94941d9cb26bb86045452b4a174a357b65a30c99/src/Framework/Telemetry/LoggingConfigurationTelemetry.cs)
20+
21+
| SDK versions | Data |
22+
|--------------|------|
23+
| >= 8.0.100 | Indication if terminal logger was used. |
24+
| >= 8.0.100 | User choice on terminal logger enablement. |
25+
| >= 8.0.100 | Source of user choice on terminal logger enablement. |
26+
| >= 8.0.100 | Default choice on terminal logger enablement. |
27+
| >= 8.0.100 | Source of default choice on terminal logger enablement. |
28+
| >= 8.0.100 | Indication if Console logger was used. |
29+
| >= 8.0.100 | Console logger type (serial, parallel). |
30+
| >= 8.0.100 | Console logger verbosity. |
31+
| >= 8.0.100 | Indication if File logger was used. |
32+
| >= 8.0.100 | File logger type (serial, parallel). |
33+
| >= 8.0.100 | Number of file loggers. |
34+
| >= 8.0.100 | File logger verbosity. |
35+
| >= 8.0.100 | Indication if Binary logger was used. |
36+
| >= 8.0.100 | Indication if Binary logger used with default log name. |
37+
38+
### BuildCheck
39+
40+
Expressed and collected via [BuildCheckTelemetry type](https://github.com/dotnet/msbuild/blob/94941d9cb26bb86045452b4a174a357b65a30c99/src/Framework/Telemetry/BuildCheckTelemetry.cs)
41+
42+
#### BuildCheck Run
43+
44+
| SDK versions | Data |
45+
|--------------|------|
46+
| >= 9.0.100 | Corelation guid for the run |
47+
| >= 9.0.100 | Count of enabled rules for the run |
48+
| >= 9.0.100 | Count of enabled custom rules for the run |
49+
| >= 9.0.100 | Count of violations encountered for the run |
50+
| >= 9.0.100 | Execution time spent by BuildCheck infrastructure and rules |
51+
52+
#### BuildCheck Rule in a run
53+
54+
| SDK versions | Data |
55+
|--------------|------|
56+
| >= 9.0.100 | Corelation guid for the run. |
57+
| >= 9.0.100 | Id of the rule. |
58+
| >= 9.0.100 | Hashed Check Friendly name. |
59+
| >= 9.0.100 | Indication if this is a built-in Check. |
60+
| >= 9.0.100 | Default severity of a Check. |
61+
| >= 9.0.100 | Number of projects that had this rule enabled. |
62+
| >= 9.0.100 | List of explicit severities set for this rule (those can vary per project - hence list). |
63+
| >= 9.0.100 | Count of diagnostics with Message severity emitted by this rule. |
64+
| >= 9.0.100 | Count of diagnostics with Warning severity emitted by this rule. |
65+
| >= 9.0.100 | Count of diagnostics with Error severity emitted by this rule. |
66+
| >= 9.0.100 | Indication whether the rule was throttled. |
67+
| >= 9.0.100 | Execution time spent by executing the Check defining this rule |
68+
69+
#### BuildCheck Extensibility issues
70+
71+
| SDK versions | Data |
72+
|--------------|------|
73+
| >= 9.0.100 | Corelation guid for the run. |
74+
| >= 9.0.100 | Hashed name of assembly that was referenced as a custom Check. |
75+
| >= 9.0.100 | Hashed exception type thrown when attempting to load the custom check. |
76+
| >= 9.0.100 | Hashed exception message thrown when attempting to load the custom check. |
77+
78+
### General Build
79+
80+
Expressed and collected via [BuildTelemetry type](https://github.com/dotnet/msbuild/blob/94941d9cb26bb86045452b4a174a357b65a30c99/src/Framework/Telemetry/BuildTelemetry.cs)
81+
82+
| SDK versions | Data |
83+
|--------------|------|
84+
| All | Display version of the Engine suitable for display to a user. |
85+
| All | Duration of the build - from when it was requested (via API or CLI). |
86+
| All | Duration of the build - from when it was started by internal BuildManager. |
87+
| All | Build engine runtime name. |
88+
| All | Host in which MSBuild build was executed (e.g. "VS", "VSCode", "Azure DevOps", "GitHub Action", "CLI"). |
89+
| All | State of MSBuild server process before this build (one of 'cold', 'hot', null (if not run as server)). |
90+
| All | Path to project file. |
91+
| All | MSBuild server fallback reason (either "ServerBusy", "ConnectionError" or null (no fallback)). |
92+
| All | Overall build success (true, false). |
93+
| All | Build target. |
94+
| All | Version of MSBuild. |
95+
| >= 9.0.100 | Indication of enablement of BuildCheck feature. |
96+
| >= 9.0.100 | Indication of Smart App Control being in evaluation mode on machine executing the build. |

0 commit comments

Comments
 (0)