Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Instrument applications with Azure Application Insights for telemetry, tracing, and performance monitoring
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/azure-monitor-opentelemetry-ts.md
1# Azure Monitor OpenTelemetry — TypeScript SDK Quick Reference23> Condensed from **azure-monitor-opentelemetry-ts**. Full patterns4> (ESM loader, custom span processors, manual exporters, live metrics)5> in the **azure-monitor-opentelemetry-ts** plugin skill if installed.67## Install8npm install @azure/monitor-opentelemetry910## Quick Start11```typescript12import { useAzureMonitor } from "@azure/monitor-opentelemetry";13useAzureMonitor({14azureMonitorExporterOptions: {15connectionString: process.env.APPLICATIONINSIGHTS_CONNECTION_STRING16}17});18```1920## Best Practices21- Call useAzureMonitor() first — before importing other modules22- Use ESM loader for ESM projects — `--import @azure/monitor-opentelemetry/loader`23- Enable offline storage for reliable telemetry in disconnected scenarios24- Set sampling ratio for high-traffic applications25- Add custom dimensions — use span processors for enrichment26- Graceful shutdown — call shutdownAzureMonitor() to flush telemetry27