跳到正文
Skillpedia
部署与云(DevOps)40k · #7052

appinsights-instrumentation

它能做什么

这个工具可以帮你为 Web 应用添加监控系统。它会把应用的性能和运行状况信息发送到 Azure App Insights,让你看清应用的运行情况。

适用场景

  • ✓当你想监控网站性能时。
  • ✓当你需要确认应用是否正常运行时。
  • ✓当你想在应用出现问题时收到提醒时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/appinsights-instrumentation/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/appinsights-instrumentation/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能