Skip to content

Commit 09e2c83

Browse files
committed
Introduce telemetry reporting.
- Fixes #2289 - Disabled by default - Collect telemetry/event reported by language server - Introduce wrappers for vscode-redhat-telemetry on client side - Delegate telemetry reported on server side to the wrapper - Add ability to report telemetry on configuration settings Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
1 parent cab4f38 commit 09e2c83

8 files changed

+432
-35
lines changed

.vscode/launch.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"debugWebviews": true,
1111
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
1212
"env": {
13-
"DEBUG_VSCODE_JAVA":"true"
13+
"DEBUG_VSCODE_JAVA":"true",
14+
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
1415
},
1516
"stopOnEntry": false,
1617
"sourceMaps": true,
@@ -32,7 +33,8 @@
3233
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
3334
"env": {
3435
"SERVER_PORT": "3333",
35-
"DEBUG_VSCODE_JAVA":"true"
36+
"DEBUG_VSCODE_JAVA":"true",
37+
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
3638
},
3739
"preLaunchTask": "npm: watch"
3840
},
@@ -48,7 +50,8 @@
4850
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
4951
"env": {
5052
"JDTLS_CLIENT_PORT": "5036",
51-
"DEBUG_VSCODE_JAVA":"true"
53+
"DEBUG_VSCODE_JAVA":"true",
54+
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
5255
},
5356
"preLaunchTask": "npm: watch",
5457
"rendererDebugOptions": {
@@ -67,7 +70,8 @@
6770
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
6871
"env": {
6972
"SYNTAXLS_CLIENT_PORT": "5037",
70-
"DEBUG_VSCODE_JAVA":"true"
73+
"DEBUG_VSCODE_JAVA":"true",
74+
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
7175
},
7276
"preLaunchTask": "npm: watch"
7377
},
@@ -83,7 +87,8 @@
8387
"env": {
8488
"JDTLS_CLIENT_PORT": "5036",
8589
"SYNTAXLS_CLIENT_PORT": "5037",
86-
"DEBUG_VSCODE_JAVA":"true"
90+
"DEBUG_VSCODE_JAVA":"true",
91+
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
8792
},
8893
"preLaunchTask": "npm: watch"
8994
},

USAGE_DATA.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Data collection
2+
3+
vscode-java has opt-in telemetry collection, provided by [vscode-redhat-telemetry](https://github.com/redhat-developer/vscode-redhat-telemetry).
4+
5+
## What's included in the vscode-java telemetry data
6+
7+
* vscode-java emits telemetry events when the extension starts and stops,
8+
which contain the common data mentioned on the
9+
[vscode-redhat-telemetry page](https://github.com/redhat-developer/vscode-redhat-telemetry/blob/main/USAGE_DATA.md#common-data).
10+
* The name of the build tool used to import a project (eg. Maven, Gradle, Invisible (project), etc.)
11+
* The total number of Java projects within the workspace
12+
* The lowest and highest Java compiler source level used (eg. 11 & 17)
13+
* Whether the project(s) are being imported for the first time (eg. true)
14+
* The current time (in milliseconds) at which the language server started, initialized the workspace project(s), and completed building the project(s)
15+
* The number of libraries that were indexed after project initialization
16+
* The total size (in bytes) of libraries that were indexed after project initialization
17+
* Information about the following settings. In the case of settings that store a well defined value (eg. path/url/string), we simply collect whether the setting has been set.
18+
* `java.settings.url`, `java.format.settings.url`, `java.quickfix.showAt`, `java.symbols.includeSourceMethodDeclarations`, `java.completion.guessMethodArguments`, `java.completion.postfix.enabled`, `java.cleanup.actionsOnSave`, `java.sharedIndexes.enabled`, `java.inlayHints.parameterNames.enabled`, `java.server.launchMode`, `java.autobuild.enabled`
19+
20+
## What's included in the general telemetry data
21+
22+
Please see the
23+
[vscode-redhat-telemetry data collection information](https://github.com/redhat-developer/vscode-redhat-telemetry/blob/HEAD/USAGE_DATA.md#usage-data-being-collected-by-red-hat-extensions)
24+
for information on what data it collects.
25+
26+
## How to opt in or out
27+
28+
Use the `redhat.telemetry.enabled` setting in order to enable or disable telemetry collection.
29+
30+
This extension also 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.

0 commit comments

Comments
 (0)