# Instrument Java Services with Azure Monitor

Manual Azure Monitor instrumentation can make Java telemetry setup and migration difficult. This skill provides focused OpenTelemetry examples for traces, metrics, exceptions, and exporter configuration.

## Install

```bash
npx skillstore add sickn33/azure-monitor-opentelemetry-exporter-java
```

## Metadata

- Status: approved
- Slug: sickn33-azure-monitor-opentelemetry-exporter-java
- Skillstore revision: r2
- Version status: missing
- Tree hash: b899556ec18129cfd2a43855ba700c204e1e35bbe4076a510f6d8d1d9b9f9ceb
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-monitor-opentelemetry-exporter-java
- 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
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-azure-monitor-opentelemetry-exporter-java
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-monitor-opentelemetry-exporter-java/manifest

## Capabilities

- Shows Maven dependencies for the deprecated exporter and recommended autoconfigure package.
- Explains environment variable and explicit connection string configuration.
- Demonstrates span creation, scope management, attributes, and reliable span completion.
- Shows how to register a custom span processor.
- Illustrates nested spans and exception recording.
- Provides counter, histogram, and package migration examples.

## Use Cases

- Add Java Tracing: Create spans, attributes, nested operations, and exception records for a Java service.
- Standardize Azure Telemetry: Plan consistent OpenTelemetry initialization and custom span processing across managed Java services.
- Migrate Deprecated Exporters: Replace the standalone Azure Monitor exporter with the recommended autoconfigure package.

## Prompt Templates

### Configure a New Service

```
Show the recommended Azure Monitor OpenTelemetry setup for my Java service using an environment variable connection string.
```

### Instrument an Operation

```
Design spans and useful attributes for this Java operation: [describe operation]. Include exception handling and reliable span completion.
```

### Add Service Metrics

```
Propose OpenTelemetry counters and histograms for [service workflow]. Include metric names, units, and low-cardinality attributes.
```

### Plan an Exporter Migration

```
Review my current Azure Monitor exporter setup: [describe setup]. Create a migration plan for autoconfigure, including validation and rollback steps.
```

## Limitations

- Does not execute builds, modify projects, deploy Azure resources, or validate exported telemetry.
- The standalone exporter is deprecated, so new projects should use the recommended autoconfigure package.
- Dependency versions and endpoint details require verification against current official documentation.
- Examples use placeholders and need environment-specific security, sampling, and resource configuration.

## Best Practices

- Use autoconfigure for new implementations and migrations.
- Use meaningful span names and low-cardinality attributes that support diagnosis.
- Record exceptions and always end spans through reliable scope management.

## Anti Patterns

- Do not start new projects with the deprecated standalone exporter.
- Do not place real Application Insights connection strings in source files or prompts.
- Do not add unbounded values to metric attributes or span dimensions.

## Security Audit

- Audited at: 2026-07-23T21:51:59.323\+00:00
- Summary: All 42 static findings are false positives caused by Markdown backticks, documentation links, metric labels, package paths, and ordinary Java method declarations. The skill contains inert guidance and sample code, with no command execution, credential access, reconnaissance, prompt injection, or malicious intent.

## Stats

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