You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-37Lines changed: 53 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,16 @@ It's also possible to opt-in later, by setting the `redhat.telemetry.enabled` us
14
14
15
15
From File > Preferences > Settings (On macOS: Code > Preferences > Settings), search for telemetry, and check the `Redhat > Telemetry : Enabled` setting. This will enable sending all telemetry events from Red Hat extensions going forward.
16
16
17
-
18
17
## How to disable telemetry reporting?
19
-
If you want to stop sending usage data to Red Hat, you can set the `redhat.telemetry.enabled` user setting to `false`.
18
+
19
+
If you want to stop sending usage data to Red Hat, you can set the `redhat.telemetry.enabled` user setting to `false`.
20
20
21
21
From File > Preferences > Settings (On macOS: Code > Preferences > Settings), search for telemetry, and uncheck the `Redhat > Telemetry : Enabled` setting. This will silence all telemetry events from Red Hat extensions going forward.
22
22
23
23
Additionally, and starting from version 0.5.0, this module abides by Visual Studio Code's telemetry level: if `telemetry.telemetryLevel` is set to `off`, then no telemetry events will be sent to Red Hat, even if `redhat.telemetry.enabled` is set to `true`. If `telemetry.telemetryLevel` is set to `error` or `crash`, only events containing an `error` or `errors` property will be sent to Red Hat.
24
24
25
25
# Remote configuration
26
+
26
27
Starting from version 0.5.0, Red Hat Telemetry can be remotely configured. Once every 12h (or whatever is remotely configured), [telemetry-config.json](src/config/telemetry-config.json) will be downloaded to, depending on your platform:
@@ -31,35 +32,35 @@ Starting from version 0.5.0, Red Hat Telemetry can be remotely configured. Once
31
32
32
33
This allows Red Hat extensions to limit the events to be sent, by including or excluding certain events, by name or containing properties, or by limiting the ratio of users sending data.
33
34
eg.:
35
+
34
36
- 50% of `redhat.vscode-hypothetical` users only, to report error events, excluding stackoverflows:
Extension configuration inherits and overrides the `*` configuration.
61
63
62
-
63
64
# How to use this library
64
65
65
66
## Add the `@redhat-developer/vscode-redhat-telemetry` dependency
@@ -69,7 +70,9 @@ In order to install [`@redhat-developer/vscode-redhat-telemetry`](https://github
69
70
```
70
71
npm i @redhat-developer/vscode-redhat-telemetry
71
72
```
73
+
72
74
## Contribute the `redhat.telemetry.enabled` preference
75
+
73
76
Unless your extension already depends on a telemetry-enabled Red Hat extension, it needs to declare the `redhat.telemetry.enabled` preference in its package.json, like:
74
77
75
78
```
@@ -89,7 +92,9 @@ Unless your extension already depends on a telemetry-enabled Red Hat extension,
89
92
}
90
93
}
91
94
```
95
+
92
96
## [Optional] Add a custom segment key in package.json file
97
+
93
98
By default, extensions will send their data to https://app.segment.com/redhat-devtools/sources/vscode/. In development mode, the data is sent to https://app.segment.com/redhat-devtools/sources/vs_code_tests/.
94
99
95
100
- You can specify custom segment keys in your package.json, to connect and push usage data to https://segment.com/
@@ -102,13 +107,14 @@ By default, extensions will send their data to https://app.segment.com/redhat-de
102
107
## Add the below code to your `extension.ts`
103
108
104
109
Get a reference to the RedHatService instance from your VS Code extension's `activate` method in `extension.ts`:
Once your extension is deactivated, a shutdown event, including the session duration, will automatically be sent on its behalf. However, shutdown event delivery is not guaranteed, in case VS Code is faster to exit than to send those last events.
142
149
143
150
All event properties are automatically sanitized to anonymize all paths (best effort) and references to the username.
144
151
145
-
146
152
## Publicly document your data collection
147
153
148
154
Once telemetry is in place, you need to document the extent of the telemetry collection performed by your extension.
149
-
* add a USAGE_DATA.md page to your extension's repository, listing the type of data being collected by your extension.
150
-
* add a `Data and Telemetry` paragraph at the end of your extension's README file:
151
-
> `The ***** extension collects anonymous [usage data](USAGE_DATA.md) and sends it to Red Hat servers to help improve our products and services. Read our [privacy statement](https://developers.redhat.com/article/tool-data-collection) to learn more. This extension respects the `redhat.telemetry.enabled` setting which you can learn more about at https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting`
152
155
153
-
* add a reference to your telemetry documentation page to this repository's own [USAGE_DATA.md](https://github.com/redhat-developer/vscode-redhat-telemetry/blob/HEAD/USAGE_DATA.md#other-extensions).
156
+
- add a USAGE_DATA.md page to your extension's repository, listing the type of data being collected by your extension.
157
+
- add a `Data and Telemetry` paragraph at the end of your extension's README file:
158
+
159
+
> `The ***** extension collects anonymous [usage data](USAGE_DATA.md) and sends it to Red Hat servers to help improve our products and services. Read our [privacy statement](https://developers.redhat.com/article/tool-data-collection) to learn more. This extension respects the `redhat.telemetry.enabled` setting which you can learn more about at https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting`
160
+
161
+
- add a reference to your telemetry documentation page to this repository's own [USAGE_DATA.md](https://github.com/redhat-developer/vscode-redhat-telemetry/blob/HEAD/USAGE_DATA.md#other-extensions).
154
162
155
163
### Checking telemetry during development
164
+
156
165
In your `.vscode/launch.json`:
166
+
157
167
- set the `VSCODE_REDHAT_TELEMETRY_DEBUG` environment variable to `true`, to log telemetry events in the console
158
-
- set the `REDHAT_TELEMETRY_REMOTE_CONFIG_URL` environment variable to the URL of a remote configuration file, if you need to test remote configuration
168
+
- set the `REDHAT_TELEMETRY_REMOTE_CONFIG_URL` environment variable to the URL of a remote configuration file, if you need to test remote configuration
159
169
160
170
```json
161
171
{
@@ -176,21 +186,22 @@ In your `.vscode/launch.json`:
176
186
},
177
187
```
178
188
179
-
180
189
# How to use from a VS Code webview
181
-
From a VS Code webview, since you can not rely on accessing the filesystem, you need to instanciate the `TelemetryService` from a `TelemetryServiceBuilder`, providing browser-specific implementations of services for collecting data.
190
+
191
+
From a VS Code webview, since you can not rely on accessing the filesystem, you need to instanciate the `TelemetryService` from a `TelemetryServiceBuilder`, providing browser-specific implementations of services for collecting data.
182
192
183
193
To get a reference to the TelemetryService instance for your VS Code extension:
## Usage data being collected by Red Hat Extensions
2
+
2
3
Only anonymous data is being collected by Red Hat extensions using `vscode-redhat-telemetry` facilities. The IP address of telemetry requests is not even stored on Red Hat servers.
3
4
All telemetry events are automatically sanitized to anonymize all paths (best effort) and references to the username.
4
5
5
6
### Common data
7
+
6
8
Telemetry requests may contain:
7
9
8
-
* a random anonymous user id (UUID v4), that is stored locally on `~/.redhat/anonymousId`
9
-
* the client name (VS Code, VSCodium, Eclipse Che...) and its version
10
-
* the type of client (Desktop vs Web)
11
-
* the name and version of the extension sending the event (eg. `fabric8-analytics.fabric8-analytics-vscode-extension`)
12
-
* whether the extension runs remotely or not (eg. in WSL)
13
-
* the OS name and version (and distribution name, in case of Linux)
14
-
* the user locale (eg. en_US)
15
-
* the user timezone
16
-
* the country id ( as determined by the current timezone)
10
+
- a random anonymous user id (UUID v4), that is stored locally on `~/.redhat/anonymousId`
11
+
- the client name (VS Code, VSCodium, Eclipse Che...) and its version
12
+
- the type of client (Desktop vs Web)
13
+
- the name and version of the extension sending the event (eg. `fabric8-analytics.fabric8-analytics-vscode-extension`)
14
+
- whether the extension runs remotely or not (eg. in WSL)
15
+
- the OS name and version (and distribution name, in case of Linux)
16
+
- the user locale (eg. en_US)
17
+
- the user timezone
18
+
- the country id ( as determined by the current timezone)
17
19
18
20
Common events are reported:
19
21
20
-
* when extension is started
21
-
* when extension is shutdown
22
-
- duration of the session
22
+
- when extension is started
23
+
- when extension is shutdown
24
+
- duration of the session
23
25
24
26
### Other extensions
27
+
25
28
Red Hat extensions' specific telemetry collection details can be found there:
0 commit comments