Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Azure Monitor Ingestion SDK for Java. Send custom logs to Azure Monitor via Data Collection Rules (DCR) and Data Collection Endpoints (DCE).
.claude/skills/azure-monitor-ingestion-java/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
| case-08 | ✗→✓ | ▲ Improved | — | — |
| case-13 | ✗→✓ | ▲ Improved | — | — |
| case-15 | ✗→✓ | ▲ Improved | — | — |
Client library for sending custom logs to Azure Monitor using the Logs Ingestion API via Data Collection Rules.
xml<dependency> <groupId>com.azure</groupId> <artifactId>azure-monitor-ingestion</artifactId> <version>1.2.11</version> </dependency>
Or use Azure SDK BOM:
xml<dependencyManagement> <dependencies> <dependency> <groupId>com.azure</groupId> <artifactId>azure-sdk-bom</artifactId> <version>{bom_version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.azure</groupId> <artifactId>azure-monitor-ingestion</artifactId> </dependency> </dependencies>
bashDATA_COLLECTION_ENDPOINT=https://<dce-name>.<region>.ingest.monitor.azure.com DATA_COLLECTION_RULE_ID=dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx STREAM_NAME=Custom-MyTable_CL
javaimport com.azure.identity.DefaultAzureCredential; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.monitor.ingestion.LogsIngestionClient; import com.azure.monitor.ingestion.LogsIngestionClientBuilder; DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build(); LogsIngestionClient client = new LogsIngestionClientBuilder() .endpoint("<data-collection-endpoint>") .credential(credential) .buildClient();
javaimport com.azure.monitor.ingestion.LogsIngestionAsyncClient; LogsIngestionAsyncClient asyncClient = new LogsIngestionClientBuilder() .endpoint("<data-collection-endpoint>") .credential(new DefaultAzureCredentialBuilder().build()) .buildAsyncClient();
| Concept | Description | |---------|-------------| | Data Collection Endpoint (DCE) | Ingestion endpoint URL for your region | | Data Collection Rule (DCR) | Defines data transformation and routing to tables | | Stream Name | Target stream in the DCR (e.g., Custom-MyTable_CL) | | Log Analytics Workspace | Destination for ingested logs |
javaimport java.util.List; import java.util.ArrayList; List<Object> logs = new ArrayList<>(); logs.add(new MyLogEntry("2024-01-15T10:30:00Z", "INFO", "Application started")); logs.add(new MyLogEntry("2024-01-15T10:30:05Z", "DEBUG", "Processing request")); client.upload("<data-collection-rule-id>", "<stream-name>", logs); System.out.println("Logs uploaded successfully");
For large log collections, enable concurrent uploads:
javaimport com.azure.monitor.ingestion.models.LogsUploadOptions; import com.azure.core.util.Context; List<Object> logs = getLargeLogs(); // Large collection LogsUploadOptions options = new LogsUploadOptions() .setMaxConcurrency(3); client.upload("<data-collection-rule-id>", "<stream-name>", logs, options, Context.NONE);
Handle partial upload failures gracefully:
javaLogsUploadOptions options = new LogsUploadOptions() .setLogsUploadErrorConsumer(uploadError -> { System.err.println("Upload error: " + uploadError.getResponseException().getMessage()); System.err.println("Failed logs count: " + uploadError.getFailedLogs().size()); // Option 1: Log and continue // Option 2: Throw to abort remaining uploads // throw uploadError.getResponseException(); }); client.upload("<data-collection-rule-id>", "<stream-name>", logs, options, Context.NONE);
javaimport reactor.core.publisher.Mono; List<Object> logs = getLogs(); asyncClient.upload("<data-collection-rule-id>", "<stream-name>", logs) .doOnSuccess(v -> System.out.println("Upload completed")) .doOnError(e -> System.err.println("Upload failed: " + e.getMessage())) .subscribe();
javapublic class MyLogEntry { private String timeGenerated; private String level; private String message; public MyLogEntry(String timeGenerated, String level, String message) { this.timeGenerated = timeGenerated; this.level = level; this.message = message; } // Getters required for JSON serialization public String getTimeGenerated() { return timeGenerated; } public String getLevel() { return level; } public String getMessage() { return message; } }
javaimport com.azure.core.exception.HttpResponseException; try { client.upload(ruleId, streamName, logs); } catch (HttpResponseException e) { System.err.println("HTTP Status: " + e.getResponse().getStatusCode()); System.err.println("Error: " + e.getMessage()); if (e.getResponse().getStatusCode() == 403) { System.err.println("Check DCR permissions and managed identity"); } else if (e.getResponse().getStatusCode() == 404) { System.err.println("Verify DCE endpoint and DCR ID"); } }
maxConcurrency for large uploadsLogsIngestionAsyncClient for reactive patternsUse azure-monitor-query to query ingested logs:
java// See azure-monitor-query skill for LogsQueryClient usage String query = "MyTable_CL | where TimeGenerated > ago(1h) | limit 10";
| Resource | URL | |----------|-----| | Maven Package | https://central.sonatype.com/artifact/com.azure/azure-monitor-ingestion | | GitHub | https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/monitor/azure-monitor-ingestion | | Product Docs | https://learn.microsoft.com/azure/azure-monitor/logs/logs-ingestion-api-overview | | DCE Overview | https://learn.microsoft.com/azure/azure-monitor/essentials/data-collection-endpoint-overview | | DCR Overview | https://learn.microsoft.com/azure/azure-monitor/essentials/data-collection-rule-overview | | Troubleshooting | https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/monitor/azure-monitor-ingestion/TROUBLESHOOTING.md |
This skill is applicable to execute the workflow or actions described in the overview.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.