Skip to content

📈 Add telemetry infrastructure, events and documentation#22

Merged
savannahostrowski merged 21 commits intomainfrom
telemetry
Jan 27, 2026
Merged

📈 Add telemetry infrastructure, events and documentation#22
savannahostrowski merged 21 commits intomainfrom
telemetry

Conversation

@savannahostrowski
Copy link
Member

@savannahostrowski savannahostrowski commented Jan 21, 2026

Closes https://github.com/fastapilabs/cloud/issues/2430 and https://github.com/fastapilabs/cloud/issues/2431
Alrighty, this PR adds anonymous usage telemetry to the extension.

I've added events for:

  • Extension lifecycle - Activation, deactivation, and activation failures
  • Entrypoint detection - So we can track which detection methods work best (config/pyproject/heuristic)
  • Feature usage - Tree view visibility, search execution, CodeLens interactions
  • User interactions - Route navigation, route copying, CodeLens clicks (batched)

All extension events are prefixed with extension_

All events automatically include:

  • Client type (VS Code Desktop, Cursor, Codespaces, etc.)
  • Platform and architecture (darwin/linux/win32, arm64/x64)
  • Extension version
  • Python and FastAPI versions (from active interpreter if the Python extension for VS Code is activated)
  • Session ID
  • Workspace metadata (folder count, routes/routers discovered)

Notes about opt-in/out:

  • Telemetry is opt-in by default but respects VS Code's global telemetry settings
  • We have our own setting for enabling telemetry fastapi.telemetry.enabled
  • TELEMETRY.md explains what we collect and why

Tested across VS Code Desktop, GitHub Codespaces and Cursor. Note that telemetry is not tracked in vscode.dev as the posthog library uses Node APIs that are incompatible. I've also set up a dashboard in PostHog.

@savannahostrowski savannahostrowski marked this pull request as ready for review January 22, 2026 19:32
@tiangolo tiangolo changed the title 📈 Add telemetry infrastructure, events and documentation 📈 Add telemetry infrastructure, events and documentation Jan 23, 2026
Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks great! 🚀

I have a couple of questions, but more as questions than suggestions. 🤓

* Uses the Python extension API if available and already active.
* If not active, events will not have version info.
*/
export async function getInstalledVersions(): Promise<{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also get the versions for:

fastapi-cli, fastapi-cloud-cli, typer, starlette, pydantic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚀

@savannahostrowski savannahostrowski merged commit cb0b2fb into main Jan 27, 2026
5 checks passed
@savannahostrowski savannahostrowski deleted the telemetry branch January 27, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants