Thanks to visit codestin.com
Credit goes to github.com

Skip to content

πŸ“ˆ Add telemetry infrastructure, events and documentation#22

Merged
savannahostrowski merged 21 commits into
mainfrom
telemetry
Jan 27, 2026
Merged

πŸ“ˆ Add telemetry infrastructure, events and documentation#22
savannahostrowski merged 21 commits into
mainfrom
telemetry

Conversation

@savannahostrowski

@savannahostrowski savannahostrowski commented Jan 21, 2026

Copy link
Copy Markdown
Member

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

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

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. πŸ€“

Comment thread src/utils/telemetry/client.ts
Comment thread src/utils/telemetry/client.ts
Comment thread src/utils/telemetry/vscode.ts Outdated
* 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
Copy Markdown
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
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

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