appinsights-instrumentation
它能做什么
这个工具可以帮你为 Web 应用添加监控系统。它会把应用的性能和运行状况信息发送到 Azure App Insights,让你看清应用的运行情况。
适用场景
- ✓当你想监控网站性能时。
- ✓当你需要确认应用是否正常运行时。
- ✓当你想在应用出现问题时收到提醒时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/appinsights-instrumentation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为我部署在 Azure 上的 Node.js Web 应用添加监控。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会先检查你的应用类型和托管位置。然后它可以尝试自动完成监控配置,或者指导你手动操作,比如在应用代码中添加监控,或使用 Azure 工具进行设置。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
AppInsights instrumentation
This skill enables sending telemetry data of a webapp to Azure App Insights for better observability of the app's health.
When to use this skill
Use this skill when the user wants to enable telemetry for their webapp.
Prerequisites
The app in the workspace must be one of these kinds
- An ASP.NET Core app hosted in Azure
- A Node.js app hosted in Azure
Guidelines
Collect context information
Find out the (programming language, application framework, hosting) tuple of the application the user is trying to add telemetry support in. This determines how the application can be instrumented. Read the source code to make an educated guess. Confirm with the user on anything you don't know. You must always ask the user where the application is hosted (e.g. on a personal computer, in an Azure App Service as code, in an Azure App Service as container, in an Azure Container App, etc.).
Prefer auto-instrument if possible
If the app is a C# ASP.NET Core app hosted in Azure App Service, use AUTO guide to help user auto-instrument the app.
Manually instrument
Manually instrument the app by creating the AppInsights resource and update the app's code.
Create AppInsights resource
Use one of the following options that fits the environment.
- Add AppInsights to existing Bicep template. See examples/appinsights.bicep for what to add. This is the best option if there are existing Bicep template files in the workspace.
- Use Azure CLI. See scripts/appinsights.ps1 for what Azure CLI command to execute to create the App Insights resource.
No matter which option you choose, recommend the user to create the App Insights resource in a meaningful resource group that makes managing resources easier. A good candidate will be the same resource group that contains the resources for the hosted app in Azure.
Modify application code
- If the app is an ASP.NET Core app, see ASPNETCORE guide for how to modify the C# code.
- If the app is a Node.js app, see NODEJS guide for how to modify the JavaScript/TypeScript code.
- If the app is a Python app, see PYTHON guide for how to modify the Python code.
常见问题
什么是 Azure App Insights?
它是 Azure 的一项服务,可以收集应用的遥测数据(即性能和使用情况信息),帮助你监控应用的健康状况并发现问题。
我的应用必须部署在 Azure 上吗?
是的。此功能适用于已经部署在 Azure 上的 Web 应用,比如 ASP.NET Core 或 Node.js 应用。
我怎么知道我的应用用的是什么语言?
工具会尝试自动判断。但如果你的应用是用 C#(ASP.NET Core)、JavaScript/TypeScript(Node.js)或 Python 编写的,你可能需要自己告诉它。
详情
作者的原始描述
Instrument a webapp to send useful telemetry data to Azure App Insights
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7052
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。