vscode-docs icon indicating copy to clipboard operation
vscode-docs copied to clipboard

Improve extension telemetry documentation

Open ntrogh opened this issue 1 year ago • 2 comments

The documentation for adding telemetry to extensions is unclear and incomplete.

Add more descriptive steps about how extension authors can:

  • Capture telemetry for an extension (TelemetryReporter ?)
  • Store telemetry events (@vscode/extension-telemetry ?)

@isidorn FYI

ntrogh avatar Aug 01 '24 12:08 ntrogh

I am confused about the recommended way for extension authors to log and send telemetry data to Application Insights.

@isidorn @lramos15 @ntrogh

In June 2019, the original gettingstarted/telemetry docs were added and instructed users to use the vscode-extension-telemetry npm module.

In May 2022, the docs were moved to extension-guides/telemetry and modified to suggest a renamed NPM module - @vscode/extension-telemetry.

In January 2023, vscode.env.createTelemetryLogger and vscode.TelemetryLogger were committed when the API was finalized and announced in the 1.75 update notes

The @vscode/extension-telemetry NPM module is still recommended by extension-guides/telemetry and frequently updated; 8 patch updates in the last year.

So we now have:

  • TelemetryReporter from @vscode/extension-telemetry which supports sending properties and measurements to Application Insights
  • TelemetryLogger from @types/vscode which only supports sending properties to a TelemetrySender

When should each one be used? Are they meant to work together?


I also cannot see any Output channel for "Telemetry" or "Extension Telemetry" or open a "Telemetry" log file as is mentioned several times in the guides and docs.

Image Image

urbanfly avatar Dec 19 '24 16:12 urbanfly

@urbanfly Let me try to answer your questions, thank you for the feedback as it is helpful for clarifying the docs!

  • @vscode/extension-telemetry is the recommended way if using application insights. Under the hood this uses the TelemetryLogger API you mentioned
  • TelemetryLogger is recommended if you are sending to alternative data warehouses as we only provide a package for App insights
  • The telemetry logs will show with either flow and to make them show you must do F1 -> Set Log Level -> Trace

lramos15 avatar Dec 19 '24 17:12 lramos15