Improve extension telemetry documentation
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
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:
-
TelemetryReporterfrom@vscode/extension-telemetrywhich supports sending properties and measurements to Application Insights -
TelemetryLoggerfrom@types/vscodewhich only supports sending properties to aTelemetrySender
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.
@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
TelemetryLoggerAPI you mentioned -
TelemetryLoggeris 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