microsoft / vscode-extension-telemetry

Node module to help VS Code extensions send telemetry using application insights
https://www.npmjs.com/package/@vscode/extension-telemetry
Other
125 stars 46 forks source link

`0.9.0` not sending telemetry information #192

Closed mattseddon closed 4 months ago

mattseddon commented 9 months ago

Thank you for the great package. We've been using it for a long time in vscode-dvc.

Last week shipped a version of the extension with 0.9.0 of @vscode/extension-telemetry included. As you can see from the below graph, we have experienced a significant drop off in activity since we shipped the update:

image

I have manually verified that there is an issue by installing the extension and triggering events. There were no issues in the extension telemetry output channel. However, no data is being received/recorded in Azure app insights for that session.

Please LMK if I have done something wrong and there is further config required to upgrade from 0.8.5 to 0.9.0.

Thanks

lramos15 commented 9 months ago

Will take a look, we made a larger change in 0.9 to reduce bundle size, but maybe that somehow messed up the sending. I will investigate further and see what might be happening here 👍

lramos15 commented 9 months ago

I just tried out a test extension I have with 0.9.0 and I receive events. I've not needed to do anything to upgrade, the extension was previously using 0.8.5

mattseddon commented 9 months ago

@lramos15 could this have anything to do with sending custom properties with events? Nearly all of our events contain custom properties.

After reverting to 0.8.5 we've seen an uptick:

image
lramos15 commented 9 months ago

@lramos15 could this have anything to do with sending custom properties with events? Nearly all of our events contain custom properties.

Not sure I follow? Could you share an example telemetry call with this custom properties

mattseddon commented 9 months ago

Not sure I follow?

I was wondering whether or not you sent properties: TelemetryEventProperties and/or measurements: TelemetryEventMeasurements when you tried out the test extension.

One example of a call to our sendTelemetryEvent function is below:

        sendTelemetryEvent(
          EventName.EXTENSION_LOAD,
          {
                cliAccessible: this.cliAccessible,
                dvcPathUsed: !!this.config.getCliPath(),
                dvcRootCount: this.getRoots().length,
                msPythonInstalled: this.config.isPythonExtensionInstalled(),
                msPythonUsed: await this.isPythonExtensionUsed(),
                pythonPathUsed: !!this.config.getPythonBinPath(),
                workspaceFolderCount: getWorkspaceFolderCount()
          },
          { duration: stopWatch.getElapsedTime() }
        )

the function sendTelemetryEvent sanitises the inputs and then calls the reporter like this:

  reporter.sendTelemetryEvent(
    eventName as string,
    { ...sanitizedProperties, user_id: getUserId() },
    measurements
  )

The code can be found here: https://github.com/iterative/vscode-dvc/blob/main/extension/src/telemetry/index.ts#L75

lramos15 commented 9 months ago

Still trying to repro this but I am sending both properties and measurements without issue.

lramos15 commented 8 months ago

@mattseddon Can you reproduce with a basic hello world extension sample that just has telemetry?

lramos15 commented 4 months ago

Will close the issue as stale for now as I cannot reproduce but if you have an easy repro I would love to get this fixed for you

mattseddon commented 4 months ago

No worries, I don't have time to try and set one up. The extension that I was working on can stay on the old version. Thanks.