redhat-developer / vscode-redhat-telemetry

21 stars 25 forks source link

Honor global VS Code telemetry setting #18

Open prettyv opened 1 year ago

prettyv commented 1 year ago

Currently telemetry settings are exclusively controlled via the custom redhat.telemetry.enabled setting, which needs to be specified in each Red Hat extension's package.json as a configuration property, leading to warning messages in the Developer Console when multiple Red Hat extensions are installed, as e.g. reported here:

[redhat.vscode-yaml]: Cannot register 'redhat.telemetry.enabled'. This property is already registered.

The official Telemetry extension authors guide mentions in Without the telemetry module:

Extension authors who wish not to use Application Insights can utilize their own custom solution to send telemetry. In this case, it is still required that extension authors respect the user's choice by utilizing the isTelemetryEnabled and onDidChangeTelemetryEnabled API. By doing this, users will have one centralized place to control their telemetry settings.

and then in Custom telemetry settings:

Adding a custom telemetry setting is not an exemption from respecting a user's decision and the isTelemetryEnabled and onDidChangeTelemetryEnabled flag must always be respected. If isTelemetryEnabled reports false, even if your setting is enabled, telemetry must not be sent.

The mentioned isTelemetryEnabled boolean setting is part of the VS Code API's dev namespace: https://code.visualstudio.com/api/references/vscode-api#env

Would it be feasible to eventually migrate over to the global setting or are there other concerns around this?

fbricon commented 1 year ago

This recommendation (relying on isTelemetryEnabled ) is fairly new, as I checked it a few weeks ago. We can certainly adapt to the new recommendation from now on.

prettyv commented 1 year ago

Ah, the dedicated telemetry extension guide page was indeed just authored at the start of May and the wording adjusted to put more emphasis on respecting the global flag. Good to hear that there is willingness to adapt to this, much appreciated!

prettyv commented 1 year ago

Another aspect I just noticed while going through the changes for the new version of vscode-xml (Add usesOnlineServices tag) is that depending on which installed extension that provides the redhat.telemetry.enabled setting is activated first that extension's setting properties win.

In this case not all Red Hat extensions I have installed locally specify the newly added tag for the setting so I didn't find it when filtering my settings by @tag:usesOnlineServices. Concretely this time "Openshift.io configuration" was first, where I'm not even sure which extension this is coming from since I don't have any of the OpenShift extensions installed.

thegecko commented 1 year ago

I would like to second this request. We see a popup message asking the user consent for feedback very often. This shouldn't appear and instead be using the global vscode telemetry setting.