appinsights-instrumentation

Instrument ASP.NET Core and Node.js apps with Azure Application Insights telemetry.

Updated Dec 20, 2023
One-click install
npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill appinsights-instrumentation-thiago-cruz-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: appinsights-instrumentation
Source: https://github.com/Thiago-Cruz-eng/Hibrygame/tree/main/.claude/skills/appinsights-instrumentation
Command: npx skills add https://github.com/Thiago-Cruz-eng/Hibrygame --skill appinsights-instrumentation-thiago-cruz-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires az, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you add Azure Application Insights telemetry to a web app with clear guidance on SDK setup and configuration, so you can observe performance and troubleshoot issues using the right patterns.

Core Features & Use Cases

  • Decision guidance (when to use guidance vs changes): Explains when to provide reference material and when to switch to an orchestrator that performs actual modifications.
  • Manual instrumentation workflow: Covers creating the App Insights resource and updating the application code for ASP.NET Core and Node.js using Azure Monitor / OpenTelemetry.
  • Connection string configuration: Shows how to set APPLICATIONINSIGHTS_CONNECTION_STRING as an environment variable (including IaC-friendly guidance) rather than relying on deprecated appsettings.json.

Quick Start

Ask: "My Azure-hosted Node.js app needs Application Insights—what exact steps should I follow to set up the App Insights resource, configure APPLICATIONINSIGHTS_CONNECTION_STRING, and instrument the app with Azure Monitor OpenTelemetry?"

Frequently Asked Questions about appinsights-instrumentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I instrument a Node.js web app with Azure Application Insights?

Instrumenting a Node.js app with Azure Application Insights requires creating the App Insights resource, installing Azure Monitor OpenTelemetry packages, and configuring the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable to start collecting telemetry data.

What is the correct way to configure the Application Insights connection string?

The correct way to configure the Application Insights connection string is by setting the APPLICATIONINSIGHTS_CONNECTION_STRING as an environment variable. Relying on deprecated appsettings.json configurations is discouraged in favor of environment variables for IaC-friendly deployments.

Can I use OpenTelemetry with Application Insights for ASP.NET Core apps hosted in Azure?

Yes, you can use OpenTelemetry with Application Insights for ASP.NET Core apps hosted in Azure. The instrumentation process selects the correct path and applies OpenTelemetry SDK configuration to establish telemetry collection for your web application.

What Azure resources do I need to create before setting up Application Insights instrumentation?

Before setting up Application Insights instrumentation, you need to create the Azure Application Insights resource and a Log Analytics workspace. These resources are required to store and query the telemetry data collected from your web application.

Does Application Insights instrumentation require the Azure CLI to set up resources?

Application Insights instrumentation relies on Azure CLI dependencies to provision the necessary App Insights and Log Analytics resources. You need the Azure CLI environment configured to create these resources and retrieve the required connection string.

Why should I use environment variables instead of appsettings.json for Application Insights configuration?

You should use environment variables instead of appsettings.json for Application Insights configuration because appsettings.json is deprecated for this purpose. Environment variables provide an IaC-friendly approach and ensure the APPLICATIONINSIGHTS_CONNECTION_STRING is securely managed across hosting environments.