# Send Java Logs to Azure Monitor

Sending structured application logs to Azure Monitor requires correct SDK, endpoint, rule, and stream configuration. This skill provides Java patterns for reliable synchronous and asynchronous ingestion.

## Install

```bash
npx skillstore add sickn33/azure-monitor-ingestion-java
```

## Metadata

- Status: approved
- Slug: sickn33-azure-monitor-ingestion-java
- Skillstore revision: r2
- Version status: missing
- Tree hash: 41bc46e21e7cdf63e3190ab78711d00424e184e0ed5d9f7df663df3f1c3758fe
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-monitor-ingestion-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-ingestion-java
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-monitor-ingestion-java/manifest

## Capabilities

- Configure the Maven dependency directly or through the Azure SDK BOM.
- Create synchronous and asynchronous clients with DefaultAzureCredential.
- Upload custom log collections to a specified DCR and stream.
- Set maximum concurrency for large uploads.
- Handle partial upload failures and HTTP response errors.
- Define a serializable Java log model and a sample KQL query.

## Use Cases

- Add Application Log Ingestion: Create a Java client and upload structured application events to an existing Azure Monitor stream.
- Standardize Azure Log Delivery: Align Java services with approved Data Collection Endpoints, Rules, stream names, and credential handling.
- Improve Upload Reliability: Apply batching, concurrency, asynchronous uploads, and partial-failure handling to operational telemetry flows.

## Prompt Templates

### Create a Basic Client

```
Show how to add Azure Monitor Ingestion to a Maven Java project and create a synchronous client with DefaultAzureCredential. Use Azure placeholders.
```

### Upload Structured Logs

```
Generate a Java example that uploads my [log fields] to DCR [rule ID] and stream [stream name]. Include a serializable model.
```

### Handle Scale and Failures

```
Adapt my upload flow for [record count] using batching, maximum concurrency, and partial-failure handling. Explain each tuning choice.
```

### Design an Async Upload Flow

```
Create a Reactor-based Java ingestion flow for [workload]. Include client reuse, success callbacks, error callbacks, concurrency guidance, and validation steps.
```

## Limitations

- Requires an existing DCE, DCR, Log Analytics workspace, and target table.
- Does not provision Azure resources, identities, or role assignments.
- Uses placeholders that must be replaced with environment-specific values.
- Does not validate schemas, authentication, network access, or production throughput.

## Best Practices

- Reuse one client and batch records to reduce connection and request overhead.
- Match every log field to the DCR transformation and destination table schema.
- Test concurrency, authentication, and partial-failure behavior in the target Azure environment.

## Anti Patterns

- Do not embed credentials, access tokens, or tenant secrets in Java source.
- Do not send records individually when a bounded batch can meet latency requirements.
- Do not ignore failed entries or assume an accepted batch means every record succeeded.

## Security Audit

- Audited at: 2026-07-23T21:45:27.487\+00:00
- Summary: All 34 static findings are false positives caused by Markdown backticks, Azure endpoint and documentation URLs, and a misclassified Maven link. SKILL.md contains documentation and Java examples only; it does not execute commands, access Azure credential files, or contain prompt injection.

## Stats

- Views: 112
- Downloads: 7
- Favorites: 0
- Popularity score: 0
