mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Add data prompt (#267543)
For querying telemetry data. Uses the Azure MCP Server's kusto tool.
This commit is contained in:
committed by
GitHub
parent
ada50f7949
commit
b20a91e37a
50
.github/prompts/data.prompt.md
vendored
Normal file
50
.github/prompts/data.prompt.md
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
mode: agent
|
||||||
|
description: 'Answer data questions by querying telemetry docs and Kusto data.'
|
||||||
|
tools: ['edit', 'search', 'extensions', 'fetch', 'usages', 'runCommands', 'todos', 'kusto']
|
||||||
|
---
|
||||||
|
|
||||||
|
<overview>
|
||||||
|
Your goal is to answer questions about VS Code telemetry data, events, properties, and related documentation by using the context from the vscode-telemetry-docs repository.
|
||||||
|
</overview>
|
||||||
|
|
||||||
|
<instructions>
|
||||||
|
Before answering any telemetry-related questions:
|
||||||
|
|
||||||
|
1. **Check for Kusto tool**: Verify that the `kusto` tool is available for querying telemetry data
|
||||||
|
- If the Kusto tool is not available, inform the user to install the "Azure MCP Server" VS Code extension
|
||||||
|
- This extension provides access to Kusto/Azure Data Explorer functionality needed for telemetry queries
|
||||||
|
|
||||||
|
2. **Check for telemetry docs**: First verify that the `vscode-telemetry-docs/` folder exists in the workspace
|
||||||
|
- If it doesn't exist, inform the user to run `npm run mixin-telemetry-docs` to clone the telemetry documentation
|
||||||
|
- Wait for the user to run this command before proceeding
|
||||||
|
|
||||||
|
3. **Read context**: Once the folder exists, read the file `vscode-telemetry-docs/.github/copilot-instructions.md` to understand:
|
||||||
|
- The structure and purpose of the telemetry documentation
|
||||||
|
- How to navigate and interpret the telemetry data
|
||||||
|
- Key concepts and terminology used in VS Code telemetry
|
||||||
|
|
||||||
|
4. **Run actual queries**: Don't just describe what could be queried - actually execute Kusto queries to provide real data and insights:
|
||||||
|
- Use the appropriate Kusto cluster and database for the data type
|
||||||
|
- Always include proper time filtering to limit data volume
|
||||||
|
- Default to a rolling 28-day window if no specific timeframe is requested
|
||||||
|
- Format and present the query results clearly to answer the user's question
|
||||||
|
|
||||||
|
5. **Use proper time windows**: When no specific timeframe is provided:
|
||||||
|
- Default to a rolling 28-day window (standard practice in VS Code telemetry)
|
||||||
|
- Use full day boundaries to avoid partial day data
|
||||||
|
- Follow the time filtering patterns from the telemetry documentation
|
||||||
|
|
||||||
|
6. **Be specific**: Reference specific files, sections, or examples from the telemetry docs when possible to support your answers
|
||||||
|
|
||||||
|
7. **Stay focused**: Keep answers focused on telemetry-related topics and data questions
|
||||||
|
</instructions>
|
||||||
|
|
||||||
|
<format>
|
||||||
|
Your response should include:
|
||||||
|
- The actual Kusto query executed (formatted nicely)
|
||||||
|
- Real query results with data to answer the user's question
|
||||||
|
- Interpretation and analysis of the results
|
||||||
|
- References to specific documentation files when applicable
|
||||||
|
- Additional context or insights from the telemetry data
|
||||||
|
</format>
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -22,3 +22,4 @@ product.overrides.json
|
|||||||
*.snap.actual
|
*.snap.actual
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
.vscode-test
|
.vscode-test
|
||||||
|
vscode-telemetry-docs/
|
||||||
|
|||||||
34
build/npm/mixin-telemetry-docs.mjs
Normal file
34
build/npm/mixin-telemetry-docs.mjs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
import { execSync } from 'child_process';
|
||||||
|
import { join, resolve } from 'path';
|
||||||
|
import { existsSync, rmSync } from 'fs';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
|
const rootPath = resolve(fileURLToPath(import.meta.url), '..', '..', '..');
|
||||||
|
const telemetryDocsPath = join(rootPath, 'vscode-telemetry-docs');
|
||||||
|
const repoUrl = 'https://github.com/microsoft/vscode-telemetry-docs';
|
||||||
|
|
||||||
|
console.log('Cloning vscode-telemetry-docs repository...');
|
||||||
|
|
||||||
|
// Remove existing directory if it exists
|
||||||
|
if (existsSync(telemetryDocsPath)) {
|
||||||
|
console.log('Removing existing vscode-telemetry-docs directory...');
|
||||||
|
rmSync(telemetryDocsPath, { recursive: true, force: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Clone the repository (shallow clone of main branch only)
|
||||||
|
console.log(`Cloning ${repoUrl} to ${telemetryDocsPath}...`);
|
||||||
|
execSync(`git clone --depth 1 --branch main --single-branch ${repoUrl} vscode-telemetry-docs`, {
|
||||||
|
cwd: rootPath,
|
||||||
|
stdio: 'inherit'
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('Successfully cloned vscode-telemetry-docs repository.');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Failed to clone vscode-telemetry-docs repository:', error.message);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
"7z": "7z",
|
"7z": "7z",
|
||||||
"update-grammars": "node build/npm/update-all-grammars.mjs",
|
"update-grammars": "node build/npm/update-all-grammars.mjs",
|
||||||
"update-localization-extension": "node build/npm/update-localization-extension.js",
|
"update-localization-extension": "node build/npm/update-localization-extension.js",
|
||||||
|
"mixin-telemetry-docs": "node build/npm/mixin-telemetry-docs.mjs",
|
||||||
"smoketest": "node build/lib/preLaunch.js && cd test/smoke && npm run compile && node test/index.js",
|
"smoketest": "node build/lib/preLaunch.js && cd test/smoke && npm run compile && node test/index.js",
|
||||||
"smoketest-no-compile": "cd test/smoke && node test/index.js",
|
"smoketest-no-compile": "cd test/smoke && node test/index.js",
|
||||||
"download-builtin-extensions": "node build/lib/builtInExtensions.js",
|
"download-builtin-extensions": "node build/lib/builtInExtensions.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user