Skip to content

Commit

Permalink
Introduce telemetry reporting.
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
rgrunber committed Mar 29, 2023
1 parent cab4f38 commit 09e2c83
Show file tree
Hide file tree
Showing 8 changed files with 432 additions and 35 deletions.
15 changes: 10 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"debugWebviews": true,
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"env": {
"DEBUG_VSCODE_JAVA":"true"
"DEBUG_VSCODE_JAVA":"true",
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
},
"stopOnEntry": false,
"sourceMaps": true,
Expand All @@ -32,7 +33,8 @@
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
"env": {
"SERVER_PORT": "3333",
"DEBUG_VSCODE_JAVA":"true"
"DEBUG_VSCODE_JAVA":"true",
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
},
"preLaunchTask": "npm: watch"
},
Expand All @@ -48,7 +50,8 @@
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
"env": {
"JDTLS_CLIENT_PORT": "5036",
"DEBUG_VSCODE_JAVA":"true"
"DEBUG_VSCODE_JAVA":"true",
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
},
"preLaunchTask": "npm: watch",
"rendererDebugOptions": {
Expand All @@ -67,7 +70,8 @@
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
"env": {
"SYNTAXLS_CLIENT_PORT": "5037",
"DEBUG_VSCODE_JAVA":"true"
"DEBUG_VSCODE_JAVA":"true",
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
},
"preLaunchTask": "npm: watch"
},
Expand All @@ -83,7 +87,8 @@
"env": {
"JDTLS_CLIENT_PORT": "5036",
"SYNTAXLS_CLIENT_PORT": "5037",
"DEBUG_VSCODE_JAVA":"true"
"DEBUG_VSCODE_JAVA":"true",
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
},
"preLaunchTask": "npm: watch"
},
Expand Down
30 changes: 30 additions & 0 deletions USAGE_DATA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Data collection

vscode-java has opt-in telemetry collection, provided by [vscode-redhat-telemetry](https://github.com/redhat-developer/vscode-redhat-telemetry).

## What's included in the vscode-java telemetry data

* vscode-java emits telemetry events when the extension starts and stops,
which contain the common data mentioned on the
[vscode-redhat-telemetry page](https://github.com/redhat-developer/vscode-redhat-telemetry/blob/main/USAGE_DATA.md#common-data).
* The name of the build tool used to import a project (eg. Maven, Gradle, Invisible (project), etc.)
* The total number of Java projects within the workspace
* The lowest and highest Java compiler source level used (eg. 11 & 17)
* Whether the project(s) are being imported for the first time (eg. true)
* The current time (in milliseconds) at which the language server started, initialized the workspace project(s), and completed building the project(s)
* The number of libraries that were indexed after project initialization
* The total size (in bytes) of libraries that were indexed after project initialization
* 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.
* `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`

## What's included in the general telemetry data

Please see the
[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)
for information on what data it collects.

## How to opt in or out

Use the `redhat.telemetry.enabled` setting in order to enable or disable telemetry collection.

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.
Loading

0 comments on commit 09e2c83

Please sign in to comment.