{"id":13758275,"url":"https://github.com/Microsoft/vscode-extension-telemetry","last_synced_at":"2025-05-10T07:30:48.255Z","repository":{"id":38705373,"uuid":"51181395","full_name":"microsoft/vscode-extension-telemetry","owner":"microsoft","description":"Node module to help VS Code extensions send telemetry using application insights","archived":false,"fork":false,"pushed_at":"2025-03-18T17:17:55.000Z","size":1054,"stargazers_count":133,"open_issues_count":8,"forks_count":53,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-05-04T05:18:07.737Z","etag":null,"topics":["nodejs","telemetry","vscode"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@vscode/extension-telemetry","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-02-05T23:47:17.000Z","updated_at":"2025-04-24T13:59:01.000Z","dependencies_parsed_at":"2023-02-19T09:46:15.602Z","dependency_job_id":"ceabc70a-933a-4d18-80c0-f68837590cbc","html_url":"https://github.com/microsoft/vscode-extension-telemetry","commit_stats":{"total_commits":316,"total_committers":31,"mean_commits":"10.193548387096774","dds":"0.45569620253164556","last_synced_commit":"6ae3c8a857353f57fa9d70aa5e1c482062e97f28"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fvscode-extension-telemetry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fvscode-extension-telemetry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fvscode-extension-telemetry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fvscode-extension-telemetry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/vscode-extension-telemetry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253133112,"owners_count":21859112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","telemetry","vscode"],"created_at":"2024-08-03T13:00:23.989Z","updated_at":"2025-05-10T07:30:48.249Z","avatar_url":"https://github.com/microsoft.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# [@vscode/extension-telemetry](https://www.npmjs.com/package/@vscode/extension-telemetry)\nThis module provides a consistent way for extensions to report telemetry\nover Application Insights. The module respects the user's decision about whether or\nnot to send telemetry data. See [telemetry extension guidelines](https://code.visualstudio.com/api/extension-guides/telemetry) for more information on using telemetry in your extension.\n\nFollow [guide to set up Application Insights](https://learn.microsoft.com/en-us/azure/azure-monitor/app/create-workspace-resource) in Azure and get your connection string. Don't worry about hardcoding it, it is not sensitive.\n\n# Install\nWith npm:\n`npm install @vscode/extension-telemetry`\n\nWith yarn:\n`yarn add @vscode/extension-telemetry`\n\n# Usage\n\n## Setup\n```javascript\nimport * as vscode from 'vscode';\nimport TelemetryReporter from '@vscode/extension-telemetry';\n\n// the connection string\nconst connectionString = '\u003cyour connection string\u003e';\n\n// telemetry reporter\nlet reporter;\n\nfunction activate(context: vscode.ExtensionContext) {\n   // create telemetry reporter on extension activation\n   reporter = new TelemetryReporter(connectionString);\n   // ensure it gets properly disposed. Upon disposal the events will be flushed\n   context.subscriptions.push(reporter);\n}\n```\n\n## Sending Events\n\nUse this method for sending general events to App Insights.\n\n```javascript\n// send event any time after activation\nreporter.sendTelemetryEvent('sampleEvent', { 'stringProp': 'some string' }, { 'numericMeasure': 123 });\n```\n\n## Sending Errors as Events\n\nUse this method for sending error telemetry as traditional events to App Insights. This method will automatically drop error properties in certain environments for first party extensions. The last parameter is an optional list of case-sensitive properties that should be dropped. If no array is passed, we will drop all properties but still send the event.\n\n```javascript\n// send an error event any time after activation\nreporter.sendTelemetryErrorEvent('sampleErrorEvent', { 'stringProp': 'some string', 'stackProp': 'some user stack trace' }, { 'numericMeasure': 123 }, [ 'stackProp' ]);\n```\n\n# Common Properties\n- **Extension Name** `common.extname` - The extension name\n- **Extension Version** `common.extversion` - The extension version\n- **Machine Identifier** `common.vscodemachineid` - A common machine identifier generated by VS Code\n- **Session Identifier** `common.vscodesessionid` - A session identifier generated by VS Code\n- **VS Code Commit** `common.vscodecommithash` - A VS Code commit hash\n- **VS Code Version** `common.vscodeversion` - The version of VS Code running the extension\n- **OS** `common.os` - The OS running VS Code\n- **Platform Version** `common.platformversion` - The version of the OS/Platform\n- **Product** `common.product` - What Vs code is hosted in, i.e. desktop, github.dev, codespaces.\n- **UI Kind** `common.uikind` - Web or Desktop indicating where VS Code is running\n- **Remote Name** `common.remotename` - A name to identify the type of remote connection. `other` indicates a remote connection not from the 3 main extensions (ssh, docker, wsl).\n- **Architecture** `common.nodeArch` - What architecture of node is running. i.e. arm or x86. On the web it will just say `web`.\n\n# License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicrosoft%2Fvscode-extension-telemetry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMicrosoft%2Fvscode-extension-telemetry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicrosoft%2Fvscode-extension-telemetry/lists"}