appinsights-instrumentation
Instrument a webapp to send useful telemetry data to Azure App Insights
适合你,如果需要在 Azure 上监控 Web 应用性能
npx oh-my-skill add boshi-xixixi/traeskill/appinsights-instrumentationcurl -fsSL https://oh-my-skill.com/install.sh | bash -s -- boshi-xixixi/traeskill/appinsights-instrumentationnpx oh-my-skill verify boshi-xixixi/traeskill/appinsights-instrumentation怎么用
商店整理自技能原文 · 版本 9cf38e6 · 表述以原文为准Claude 会帮助你对 Web 应用进行插桩,向 Azure App Insights 发送遥测数据,以便监控应用健康状态。
当用户要求为他们的 Web 应用启用遥测时触发。应用需为 ASP.NET Core 或 Node.js 并托管在 Azure 上。
技能原文 SKILL.md
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](references/AUTO.md) 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](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](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](references/ASPNETCORE.md) for how to modify the C# code.
- If the app is a Node.js app, see [NODEJS guide](references/NODEJS.md) for how to modify the JavaScript/TypeScript code.
- If the app is a Python app, see [PYTHON guide](references/PYTHON.md) for how to modify the Python code.