# Instrument Node.js Apps with Azure Monitor

Adding reliable telemetry to Node.js services requires correct initialization, exporters, and lifecycle handling. This skill provides focused Azure Monitor OpenTelemetry patterns.

## Install

```bash
npx skillstore add sickn33/azure-monitor-opentelemetry-ts
```

## Metadata

- Status: approved
- Slug: sickn33-azure-monitor-opentelemetry-ts
- Skillstore revision: r2
- Version status: missing
- Tree hash: ee275fc8e68241736d77057440e60f257e3cd1857bf7fbcf2e53b403a7a7a926
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-monitor-opentelemetry-ts
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, env\_access
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-azure-monitor-opentelemetry-ts
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-monitor-opentelemetry-ts/manifest

## Capabilities

- Shows package choices for automatic instrumentation, low-level exporters, and custom log ingestion.
- Configures Azure Monitor with connection strings, sampling, offline storage, resources, and instrumentation options.
- Demonstrates custom traces, counters, histograms, observable gauges, and span attributes.
- Explains manual trace, metric, and log exporter setup for custom OpenTelemetry pipelines.
- Covers custom log ingestion, span processing, ESM loading, and graceful telemetry shutdown.

## Use Cases

- Add Basic Service Telemetry: Configure automatic tracing, metrics, and logs for an existing Node.js service.
- Standardize Observability Setup: Create a consistent Azure Monitor configuration for multiple Node.js workloads.
- Tune Production Telemetry: Adjust sampling, storage, custom dimensions, and shutdown behavior for reliable operations.

## Prompt Templates

### Set Up Automatic Instrumentation

```
Show me how to add Azure Monitor automatic instrumentation to my Node.js service. Include installation, initialization order, and required environment variables.
```

### Add Custom Traces and Metrics

```
Design custom OpenTelemetry traces and metrics for these operations: [operations]. Include useful attributes, counters, histograms, and error recording.
```

### Build a Manual Export Pipeline

```
Plan a manual Azure Monitor export pipeline for traces, metrics, and logs. Use these constraints: [runtime, modules, traffic, storage].
```

### Review Production Readiness

```
Review my Azure Monitor OpenTelemetry approach for production. Assess initialization, sampling, offline storage, sensitive attributes, failure handling, and graceful shutdown.
```

## Limitations

- The skill does not create Azure resources, connection strings, data collection rules, or permissions.
- Examples contain placeholders that must be replaced with environment-specific Azure values.
- Package versions and API compatibility require validation against current Azure SDK documentation.
- Telemetry content, retention, cost, and privacy controls require separate organizational review.

## Best Practices

- Initialize Azure Monitor before importing instrumented application modules.
- Keep connection strings in managed environment settings and exclude secrets from telemetry attributes.
- Tune sampling and offline storage for traffic volume, reliability needs, and telemetry cost.

## Anti Patterns

- Do not initialize monitoring after application libraries have already loaded.
- Do not attach credentials, personal data, or unbounded values to spans and metrics.
- Do not terminate the process before buffered telemetry has been flushed.

## Security Audit

- Audited at: 2026-07-23T22:01:23.409\+00:00
- Summary: All 52 static findings are false positives caused by Markdown code fences, expected Azure Monitor examples, and OpenTelemetry method names. The skill contains documentation only, with no executable scripts, prompt injection, credential harvesting, or undeclared network destination.

## Stats

- Views: 102
- Downloads: 8
- Favorites: 0
- Popularity score: 0
