Azure Monitor Ingestion SDK for Java
Send Custom Logs to Azure Monitor with Java
Custom application logs need centralized monitoring in Azure. This skill helps you ingest logs to Azure Monitor using Data Collection Rules and the official Java SDK.
スキルZIPをダウンロード
Claudeでアップロード
設定 → 機能 → スキル → スキルをアップロードへ移動
オンにして利用開始
テストする
「Azure Monitor Ingestion SDK for Java」を使用しています。 Create a LogsIngestionClient using DefaultAzureCredential with endpoint from environment variable
期待される結果:
DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build();
LogsIngestionClient client = new LogsIngestionClientBuilder()
.endpoint(System.getenv("DATA_COLLECTION_ENDPOINT"))
.credential(credential)
.buildClient();
「Azure Monitor Ingestion SDK for Java」を使用しています。 Upload 3 log entries to Azure Monitor with DCR ID and stream name
期待される結果:
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"));
logs.add(new MyLogEntry("2024-01-15T10:30:10Z", "WARN", "High memory usage detected"));
client.upload(ruleId, streamName, logs);
System.out.println("Logs uploaded successfully");
セキュリティ監査
安全Documentation-only skill containing usage examples for the official Azure Monitor Ingestion SDK for Java. No executable code, no security risks detected. Static analysis found 0 files with 0 suspicious patterns. The skill provides legitimate Azure SDK integration patterns with proper authentication using DefaultAzureCredential.
品質スコア
作れるもの
Application Telemetry Ingestion
Send custom application logs, metrics, and events from Java applications to Azure Monitor for centralized monitoring and alerting.
Security Event Collection
Ingest security audit logs and compliance events to Azure Monitor SecurityEvents or CommonSecurityLog tables for SIEM integration.
Custom Business Metrics
Track business-specific events and KPIs by uploading structured logs to custom tables in Log Analytics workspace.
これらのプロンプトを試す
Create a synchronous LogsIngestionClient for Azure Monitor using environment variables for endpoint, DCR ID, and stream name. Include DefaultAzureCredential authentication.
Generate Java code to upload a list of custom log entries to Azure Monitor with partial failure handling. Log failed entries without aborting the entire batch.
Create an async upload method that sends 10000 log entries to Azure Monitor with maxConcurrency set to 5. Use Reactor Mono for reactive streaming.
Define a Java class for a custom log entry with timeGenerated, severity, source, and message fields. Include getters for JSON serialization required by the Logs Ingestion API.
ベストプラクティス
- Batch log entries before uploading instead of sending one at a time for better performance
- Set maxConcurrency option when uploading large log collections to improve throughput
- Include TimeGenerated field in log entries as most Azure Monitor tables require timestamps
回避
- Creating new client instances for each upload - reuse a single client throughout application lifecycle
- Uploading logs synchronously in high-throughput scenarios - use async client for reactive patterns
- Ignoring partial upload errors - always configure error consumer to handle failed entries
よくある質問
What prerequisites are needed before using this skill?
How do I authenticate with Azure Monitor?
Can I upload logs to custom tables?
How do I handle upload failures?
What is the difference between sync and async clients?
How do I query the logs after ingestion?
開発者の詳細
作成者
sickn33ライセンス
MIT
リポジトリ
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-monitor-ingestion-java参照
main
ファイル構成
📄 SKILL.md