Skip to content

Commit 3f7b9ef

Browse files
authored
Merge pull request #82 from JamesWTruher/jameswtruher/telemetryupdate
Recast RFC to rely on Application Insights rather than our own pipeline
2 parents 75bee75 + 739fbfb commit 3f7b9ef

File tree

1 file changed

+11
-36
lines changed

1 file changed

+11
-36
lines changed

1-Draft/RFC0016-Census-Telemetry.md

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,48 +17,23 @@ Add basic census telemetry to PowerShell.
1717

1818
Downloads numbers do not tell us if we are successful in growing usage of PowerShell.
1919
The platform (Windows, Linux, Mac) usage data helps to prioritize new feature work and investments.
20-
Version checks in applications are common and also provide a way to inform the user if a newer version is available.
21-
Send basic PowerShell and OS version information as part of version check request.
2220

2321
## Specification
2422

25-
On startup of PowerShell, the host does a check if a version check has happened that day, if so, we skip.
26-
With interactive session, user is informed there is a newer version and how to update (e.g. apt-get, update-package)
27-
A HTTP GET is performed to a well known https address (TBD) to obtain latest version information.
28-
SSL cert is validated to avoid spoofing server.
23+
On every startup of the PowerShell Console host, telemetry will be sent via [ApplicationInsights](https://azure.microsoft.com/en-us/services/application-insights/) to collect the following information:
24+
- A SHA256 hash of System.Management.Automation.dll
25+
- Environment.OSVersion.VersionString
26+
- GitCommitId (from $psversiontable)
2927

30-
### HTTP Request
28+
## Design
3129

32-
```
33-
GET /powershell/core/latestversion HTTP/1.1
34-
Accept: application/json
35-
User-Agent: PowerShell/<<$psversiontable.psedition>>/<<$psversiontable.gitcommitid>>; <<$psversiontable.osversion>>
36-
```
30+
ApplicationInsights provides a mechanism for sending a [`CustomEvent`](https://docs.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics) which is essentially three elements:
31+
- The name of the event
32+
- A dictionary of properties
33+
- A dictionary of metrics
3734

38-
Note that `$psversiontable.osversion` is dependent on [#1635](https://github.com/PowerShell/PowerShell/issues/1635) getting addressed.
39-
40-
### HTTP Response
41-
42-
```
43-
HTTP/1.1 200 Ok
44-
Content-Type: application/json
45-
Content-Length: nn
46-
Connection: close
47-
48-
{"psedition":"Core","latestversion":"6.0.0-alpha.12","severity":"critical"}
49-
```
50-
51-
Severity:
52-
- `Critical` indicates a security fix
53-
- `Optional` indicates general bug fixes/features
54-
55-
### Configuration
56-
57-
Telemetry is on by default with a means to opt-out.
58-
Since this is not the only configuration we would expose for PowerShell, we should have a [general configuration RFC] (https://github.com/PowerShell/PowerShell-RFC/blob/master/1-Draft/RFC0015-PowerShell-StartupConfig.md) to solve that, but this RFC assumes standard .config file format.
59-
60-
The census telemetry (sending `User-Agent` information) would be a specific configuration setting: `SendUserAgent=$false`.
61-
Disabling the version check request would be a different configuration setting: `PerformVersionCheck=$false`.
35+
For PowerShell Core purposes we will send only the name of the event and a dictionary of properties consisting of the list shown in the the specification.
36+
Initially, we will not provide any metrics, although we can easily do so at a later time.
6237

6338
## Alternate Proposals and Considerations
6439

0 commit comments

Comments
 (0)