

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345Patterns for GDPR-compliant telemetry in VS Code with proper type safety and privacy protection.67## Implementation Pattern89### 1. Define Types10```typescript11type MyFeatureEvent = {12 action: string;13 duration: number;14 success: boolean;15 errorCode?: string;16};1718type MyFeatureClassification = {19 action: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The action performed.' };20 duration: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Time in milliseconds.' };21 success: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'Whether action succeeded.' };22 errorCode: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Error code if action failed.' };23 owner: 'yourGitHubUsername';24 comment: 'Tracks MyFeature usage and performance.';25};26```2728### 2.1. Send Event29```typescript30this.telemetryService.publicLog2<MyFeatureEvent, MyFeatureClassification>('myFeatureAction', {31 action: 'buttonClick',32 duration: 150,33 success: true34});35```3637### 2.2. Error Events38For error-specific telemetry with stack traces or error messages:39```typescript40type MyErrorEvent = {41 operation: string;42 errorMessage: string;43 duration?: number;44};4546type MyErrorClassification = {47 operation: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'The operation that failed.' };48 errorMessage: { classification: 'CallstackOrException'; purpose: 'PerformanceAndHealth'; comment: 'The error message.' };49 duration: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'Time until failure.' };50 owner: 'yourGitHubUsername';51 comment: 'Tracks MyFeature errors for reliability.';52};5354this.telemetryService.publicLogError2<MyErrorEvent, MyErrorClassification>('myFeatureError', {55 operation: 'fileRead',56 errorMessage: error.message,57 duration: 120058});59```6061### 3. Service Injection62```typescript63constructor(64 @ITelemetryService private readonly telemetryService: ITelemetryService,65) { super(); }66```6768## GDPR Classifications & Purposes6970**Classifications (choose the most restrictive):**71- `SystemMetaData` - **Most common.** Non-personal system info, user preferences, feature usage, identifiers (extension IDs, language types, counts, durations, success flags)72- `CallstackOrException` - Error messages, stack traces, exception details. **Only for actual error information.**73- `PublicNonPersonalData` - Data already publicly available (rare)7475**Purposes (combine with different classifications):**76- `FeatureInsight` - **Default.** Understanding how features are used, user behavior patterns, feature adoption77- `PerformanceAndHealth` - **For errors & performance.** Metrics, error rates, performance measurements, diagnostics7879**Required Properties:**80- `comment` - Clear explanation of what the field contains and why it's collected81- `owner` - GitHub username (infer from branch or ask)82- `isMeasurement: true` - **Required** for all numeric values flags used in calculations8384## Error Events8586Use `publicLogError2` for errors with `CallstackOrException` classification:8788```typescript89this.telemetryService.publicLogError2<ErrorEvent, ErrorClassification>('myFeatureError', {90 errorMessage: error.message,91 errorCode: 'MYFEATURE_001',92 context: 'initialization'93});94```9596## Naming & Privacy Rules9798**Naming Conventions:**99- Event names: `camelCase` with context (`extensionActivationError`, `chatMessageSent`)100- Property names: specific and descriptive (`agentId` not `id`, `durationMs` not `duration`)101- Common patterns: `success/hasError/isEnabled`, `sessionId/extensionId`, `type/kind/source`102103**Critical Don'ts:**104- ❌ No PII (usernames, emails, file paths, content)105- ❌ Missing `owner` field in classification (infer from branch name or ask user)106- ❌ Vague comments ("user data" → "selected language identifier")107- ❌ Wrong classification108- ❌ Missing `isMeasurement` on numeric metrics109110**Privacy Requirements:**111- Minimize data collection to essential insights only112- Use hashes/categories instead of raw values when possible113- Document clear purpose for each data point114
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| microsoft/vscode.github/instructions/best-practices.instructions.md · 189k | Copilot instructions | styleui | 60/100 | 14 days ago | |
| microsoft/vscodeextensions/copilot/src/platform/authentication/common/AGENTS.md · 189k | AGENTS.md | archsecurityagent-behaviour | 58/100 | 14 days ago | |
| microsoft/vscode.github/copilot-instructions.md · 189k | Copilot instructions | stylearchtypesui+2 | 74/100 | 13 days ago | |
| microsoft/vscode.github/instructions/accessibility.instructions.md · 189k | Copilot instructions | styledo-not | 61/100 | 14 days ago | |
| microsoft/vscode.github/instructions/agentHostTesting.instructions.md · 189k | Copilot instructions | teststyletesting-strategyagent-behaviour | 55/100 | 7 days ago | |
| microsoft/vscode.github/instructions/chat.instructions.md · 189k | Copilot instructions | no sections | 39/100 | 14 days ago | |
| microsoft/vscode.github/instructions/coding-guidelines.instructions.md · 189k | Copilot instructions | styletypesuidocs | 60/100 | 14 days ago | |
| microsoft/vscode.github/instructions/committing.instructions.md · 189k | Copilot instructions | do-not | 23/100 | 14 days ago | |
| microsoft/vscode.github/instructions/css-best-practices.instructions.md · 189k | Copilot instructions | styleui | 29/100 | 14 days ago | |
| microsoft/vscode.github/instructions/design-philosophy.instructions.md · 189k | Copilot instructions | style | 34/100 | 14 days ago | |
| microsoft/vscode.github/instructions/design-tokens.instructions.md · 189k | Copilot instructions | styledo-not | 65/100 | 14 days ago | |
| microsoft/vscode.github/instructions/interactive.instructions.md · 189k | Copilot instructions | ui | 43/100 | 14 days ago | |
| microsoft/vscode.github/instructions/notebook.instructions.md · 189k | Copilot instructions | no sections | 48/100 | 14 days ago | |
| microsoft/vscodeextensions/copilot/.github/instructions/model-prompts.instructions.md · 189k | Copilot instructions | testsecurityui | 58/100 | 14 days ago | |
| microsoft/vscodeextensions/copilot/.github/instructions/prompt-tsx.instructions.md · 189k | Copilot instructions | archuiperformance | 58/100 | 14 days ago | |
| microsoft/vscodeextensions/copilot/.github/instructions/vitest-unit-tests.instructions.md · 189k | Copilot instructions | teststyletesting-strategydo-not | 51/100 | 14 days ago | |
| microsoft/vscodesrc/vs/platform/agentHost/common/state/AGENTS.md · 189k | AGENTS.md | buildarchtypesgit+2 | 64/100 | 14 days ago | |
| microsoft/vscodesrc/vs/platform/agentHost/node/copilot/prompts/AGENTS.md · 189k | AGENTS.md | styleagent-behaviour | 58/100 | 14 days ago | |
| microsoft/vscode.github/instructions/observables.instructions.md · 189k | Copilot instructions | no sections | 40/100 | 14 days ago | |
| microsoft/vscode.github/instructions/oss-third-party-notices.instructions.md · 189k | Copilot instructions | buildgitdependenciesdeployment+1 | 65/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 14 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 14 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/microsoft-vscode-github-instructions-telemetry-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.