Azure Monitor OpenTelemetry for TypeScript
Add Application Insights observability to Node.js services with OpenTelemetry.
The document exposes the main data flows involving connection strings, telemetry exporters, offline storage, and log ingestion, and shows DefaultAzureCredential and ManagedIdentityCredential usage. It lacks guidance on sensitive-data redaction, log-content boundaries, least privilege, user confirmation, external-transfer impact, and rollback, so points are deducted. No credential theft, covert exfiltration, or destructive default is evident.
Installation, initialization order, the ESM loader, sampling, shutdown, and some error handling are documented, making the happy path plausible. However, there are no skill-specific tests, dependency/version constraints, or reproducible validation, and some examples may use APIs unsafely, such as mutating span.attributes and traceFlags directly; the static ceiling and these uncertainties reduce the score.
The audience and core scenarios are clear: Node.js tracing, metrics, logs, auto-instrumentation, and manual export. Non-fit cases, runtime boundaries, privacy/compliance limits, semantic triggers, and mainland-China reachability are not stated, and the capability depends substantially on Azure services, so points are deducted.
The SKILL.md is readable and progressively organized across installation, configuration, quick start, specialized capabilities, and best practices. MIT licensing, author, and version metadata are present. It lacks a changelog, explicit maintenance owner/update path, dependency versions, troubleshooting, FAQ, known limitations, and complete parameter documentation, so it is not full marks.
The examples provide a directly useful starting point for common Node.js Azure Monitor/OpenTelemetry integrations and cover several workflows. There is no skill-specific acceptance evidence, representative verified output, or execution proof; possible API, initialization, and exporter-configuration corrections may still be required, so the static score is capped below the full range and reduced further.
The files provide concrete package names, code samples, environment variables, and general repository CI/test evidence, offering some auditability. The supplied tests do not cover this skill's key paths, and there is no skill-specific acceptance suite, third-party execution result, or pinned dependency evidence, so verifiability remains limited.
- Telemetry sent to Application Insights/Azure Monitor may contain sensitive request data, exceptions, attributes, and logs; establish classification, redaction, sampling, region, and retention policies before deployment.
- No dependency versions or compatibility matrix are provided; verify current Node.js, OpenTelemetry, and Azure SDK APIs, especially the direct mutation of attributes and traceFlags in the custom SpanProcessor example.
- The custom log-ingestion example uploads logs to an external Azure endpoint but does not specify least-privilege RBAC, retry/idempotency behavior, or pre-upload validation.
- This assessment is source-only; the examples, dependencies, and Azure connectivity were not executed or independently tested.
What it does & when to use it
This skill helps TypeScript and JavaScript developers instrument Node.js applications with Azure Monitor OpenTelemetry. It covers automatic collection of distributed traces, metrics, and logs for Application Insights, along with ESM startup, sampling, offline storage, custom resources, and graceful shutdown. It also documents manual trace, metric, and log exporters plus custom log ingestion. Adopt it when Azure Monitor is the intended telemetry backend; it is less suitable as a provider-neutral OpenTelemetry guide.
Shows how to install @azure/monitor-opentelemetry, @azure/monitor-opentelemetry-exporter, and @azure/monitor-ingestion; configure APPLICATIONINSIGHTS_CONNECTION_STRING and, when applicable, AZURE_TOKEN_CREDENTIALS; call useAzureMonitor() before importing application modules; enable automatic instrumentation through the Node.js ESM loader; configure sampling, Live Metrics, standard metrics, performance counters, offline storage, instrumentation libraries, and custom resources; create custom spans, counters, histograms, and observable gauges; configure Azure Monitor trace, metric, and log exporters manually; upload custom logs with LogsIngestionClient; add a custom SpanProcessor; and call shutdownAzureMonitor() during process shutdown.
- A Node.js service team wants automatic Application Insights telemetry for HTTP, Azure SDK, database, and logging libraries with minimal initialization.
- A TypeScript application needs distributed traces, metrics, and logs exported to Azure Monitor through a connection string.
- An ESM application running on Node.js 18.19+ needs automatic instrumentation through @azure/monitor-opentelemetry/loader.
- A high-traffic service needs sampling, offline storage, and graceful shutdown to manage telemetry volume and flushing.
- A developer needs custom spans, events, attributes, metrics, or direct control over OpenTelemetry exporters.
- An application needs to send custom log records through the Azure Monitor Logs Ingestion API.
Pros & cons
- Covers both recommended automatic instrumentation and lower-level manual exporter setup.
- Includes distributed tracing, metrics, logs, sampling, offline storage, and graceful shutdown.
- Provides TypeScript examples for custom spans, metrics, resources, and span processors.
- Highlights the important initialization order for useAzureMonitor().
- It is specifically oriented toward Azure Monitor and Application Insights rather than provider-neutral OpenTelemetry.
- Examples require Node.js, npm, Azure Monitor packages, and Azure configuration values.
- The source does not document independent test coverage for this specific skill.
- Users must provide Azure details such as a connection string, ingestion endpoint, or data collection rule identifiers for the relevant examples.
How to install
Install the collection with npx skills add microsoft/skills, then select the required skill in the wizard. The README says skills are installed to the selected agent directory, such as .github/skills/ for GitHub Copilot, and can be symlinked for multiple agents. The source does not provide a standalone installation command for azure-monitor-opentelemetry-ts. Install the runtime packages with npm install @azure/monitor-opentelemetry; for custom low-level exporters, use npm install @azure/monitor-opentelemetry-exporter; for custom log ingestion, use npm install @azure/monitor-ingestion.
How to use
Use a request such as: Instrument this TypeScript Node.js service with Azure Monitor OpenTelemetry, automatically collect traces, metrics, and logs, and configure Application Insights with APPLICATIONINSIGHTS_CONNECTION_STRING. Call useAzureMonitor() before importing other application modules. For ESM, start with node --import @azure/monitor-opentelemetry/loader ./dist/index.js. If production uses DefaultAzureCredential, set AZURE_TOKEN_CREDENTIALS=prod.
Compared to similar skills
The skill presents the recommended @azure/monitor-opentelemetry automatic-instrumentation approach alongside the lower-level @azure/monitor-opentelemetry-exporter setup. The distro is suited to faster onboarding, while the exporter route is suited to applications that need to manage OpenTelemetry providers and processors directly.