[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71RJN8XF68CXCCCSKHXZ092":3,"skill-same:01M71RJN8XF68CXCCCSKHXZ092":48},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":14,"categories":15,"keywords":16,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":26,"frontMatter":27,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":12,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M71RJN8XF68CXCCCSKHXZ092","azure-monitor-query-java",null,"javiertarazon\u002Fide-agente-free-jt7-","javiertarazon","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153141207?v=4","01M71R52TB3S9HXKH6WSNT8A7V","01M71R52VG5KS2DKDDH4GDQ30A",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-\u002Fblob\u002Frelease\u002Fv4.2.11-panel-pro\u002F.github\u002Fskills\u002Fazure-monitor-query-java\u002FSKILL.md",[],[17,18,19,20,21,22],"azure","azure monitor query java","monitor","java","query","azure monitor","2026-11-10 13:02:02",false,"---\nname: azure-monitor-query-java\ndescription: \"|\"\n  Azure Monitor Query SDK for Java. Execute Kusto queries against Log Analytics workspaces and query metrics from Azure resources.\n  Triggers: \"LogsQueryClient java\", \"MetricsQueryClient java\", \"kusto query java\", \"log analytics java\", \"azure monitor query java\".\n  Note: This package is deprecated. Migrate to azure-monitor-query-logs and azure-monitor-query-metrics.\npackage: com.azure:azure-monitor-query\nrisk: unknown\nsource: community\n---\n\n# Azure Monitor Query SDK for Java\n\n> **DEPRECATION NOTICE**: This package is deprecated in favor of:\n> - `azure-monitor-query-logs` — For Log Analytics queries\n> - `azure-monitor-query-metrics` — For metrics queries\n>\n> See migration guides: [Logs Migration](https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Fblob\u002Fmain\u002Fsdk\u002Fmonitor\u002Fazure-monitor-query-logs\u002Fmigration-guide.md) | [Metrics Migration](https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Fblob\u002Fmain\u002Fsdk\u002Fmonitor\u002Fazure-monitor-query-metrics\u002Fmigration-guide.md)\n\nClient library for querying Azure Monitor Logs and Metrics.\n\n## Installation\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>com.azure\u003C\u002FgroupId>\n    \u003CartifactId>azure-monitor-query\u003C\u002FartifactId>\n    \u003Cversion>1.5.9\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\nOr use Azure SDK BOM:\n\n```xml\n\u003CdependencyManagement>\n    \u003Cdependencies>\n        \u003Cdependency>\n            \u003CgroupId>com.azure\u003C\u002FgroupId>\n            \u003CartifactId>azure-sdk-bom\u003C\u002FartifactId>\n            \u003Cversion>{bom_version}\u003C\u002Fversion>\n            \u003Ctype>pom\u003C\u002Ftype>\n            \u003Cscope>import\u003C\u002Fscope>\n        \u003C\u002Fdependency>\n    \u003C\u002Fdependencies>\n\u003C\u002FdependencyManagement>\n\n\u003Cdependencies>\n    \u003Cdependency>\n        \u003CgroupId>com.azure\u003C\u002FgroupId>\n        \u003CartifactId>azure-monitor-query\u003C\u002FartifactId>\n    \u003C\u002Fdependency>\n\u003C\u002Fdependencies>\n```\n\n## Prerequisites\n\n- Log Analytics workspace (for logs queries)\n- Azure resource (for metrics queries)\n- TokenCredential with appropriate permissions\n\n## Environment Variables\n\n```bash\nLOG_ANALYTICS_WORKSPACE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\nAZURE_RESOURCE_ID=\u002Fsubscriptions\u002F{sub}\u002FresourceGroups\u002F{rg}\u002Fproviders\u002F{provider}\u002F{resource}\n```\n\n## Client Creation\n\n### LogsQueryClient (Sync)\n\n```java\nimport com.azure.identity.DefaultAzureCredentialBuilder;\nimport com.azure.monitor.query.LogsQueryClient;\nimport com.azure.monitor.query.LogsQueryClientBuilder;\n\nLogsQueryClient logsClient = new LogsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildClient();\n```\n\n### LogsQueryAsyncClient\n\n```java\nimport com.azure.monitor.query.LogsQueryAsyncClient;\n\nLogsQueryAsyncClient logsAsyncClient = new LogsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildAsyncClient();\n```\n\n### MetricsQueryClient (Sync)\n\n```java\nimport com.azure.monitor.query.MetricsQueryClient;\nimport com.azure.monitor.query.MetricsQueryClientBuilder;\n\nMetricsQueryClient metricsClient = new MetricsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildClient();\n```\n\n### MetricsQueryAsyncClient\n\n```java\nimport com.azure.monitor.query.MetricsQueryAsyncClient;\n\nMetricsQueryAsyncClient metricsAsyncClient = new MetricsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildAsyncClient();\n```\n\n### Sovereign Cloud Configuration\n\n```java\n\u002F\u002F Azure China Cloud - Logs\nLogsQueryClient logsClient = new LogsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .endpoint(\"https:\u002F\u002Fapi.loganalytics.azure.cn\u002Fv1\")\n    .buildClient();\n\n\u002F\u002F Azure China Cloud - Metrics\nMetricsQueryClient metricsClient = new MetricsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .endpoint(\"https:\u002F\u002Fmanagement.chinacloudapi.cn\")\n    .buildClient();\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Logs | Log and performance data from Azure resources via Kusto Query Language |\n| Metrics | Numeric time-series data collected at regular intervals |\n| Workspace ID | Log Analytics workspace identifier |\n| Resource ID | Azure resource URI for metrics queries |\n| QueryTimeInterval | Time range for the query |\n\n## Logs Query Operations\n\n### Basic Query\n\n```java\nimport com.azure.monitor.query.models.LogsQueryResult;\nimport com.azure.monitor.query.models.LogsTableRow;\nimport com.azure.monitor.query.models.QueryTimeInterval;\nimport java.time.Duration;\n\nLogsQueryResult result = logsClient.queryWorkspace(\n    \"{workspace-id}\",\n    \"AzureActivity | summarize count() by ResourceGroup | top 10 by count_\",\n    new QueryTimeInterval(Duration.ofDays(7))\n);\n\nfor (LogsTableRow row : result.getTable().getRows()) {\n    System.out.println(row.getColumnValue(\"ResourceGroup\") + \": \" + row.getColumnValue(\"count_\"));\n}\n```\n\n### Query by Resource ID\n\n```java\nLogsQueryResult result = logsClient.queryResource(\n    \"{resource-id}\",\n    \"AzureMetrics | where TimeGenerated > ago(1h)\",\n    new QueryTimeInterval(Duration.ofDays(1))\n);\n\nfor (LogsTableRow row : result.getTable().getRows()) {\n    System.out.println(row.getColumnValue(\"MetricName\") + \" \" + row.getColumnValue(\"Average\"));\n}\n```\n\n### Map Results to Custom Model\n\n```java\n\u002F\u002F Define model class\npublic class ActivityLog {\n    private String resourceGroup;\n    private String operationName;\n    \n    public String getResourceGroup() { return resourceGroup; }\n    public String getOperationName() { return operationName; }\n}\n\n\u002F\u002F Query with model mapping\nList\u003CActivityLog> logs = logsClient.queryWorkspace(\n    \"{workspace-id}\",\n    \"AzureActivity | project ResourceGroup, OperationName | take 100\",\n    new QueryTimeInterval(Duration.ofDays(2)),\n    ActivityLog.class\n);\n\nfor (ActivityLog log : logs) {\n    System.out.println(log.getOperationName() + \" - \" + log.getResourceGroup());\n}\n```\n\n### Batch Query\n\n```java\nimport com.azure.monitor.query.models.LogsBatchQuery;\nimport com.azure.monitor.query.models.LogsBatchQueryResult;\nimport com.azure.monitor.query.models.LogsBatchQueryResultCollection;\nimport com.azure.core.util.Context;\n\nLogsBatchQuery batchQuery = new LogsBatchQuery();\nString q1 = batchQuery.addWorkspaceQuery(\"{workspace-id}\", \"AzureActivity | count\", new QueryTimeInterval(Duration.ofDays(1)));\nString q2 = batchQuery.addWorkspaceQuery(\"{workspace-id}\", \"Heartbeat | count\", new QueryTimeInterval(Duration.ofDays(1)));\nString q3 = batchQuery.addWorkspaceQuery(\"{workspace-id}\", \"Perf | count\", new QueryTimeInterval(Duration.ofDays(1)));\n\nLogsBatchQueryResultCollection results = logsClient\n    .queryBatchWithResponse(batchQuery, Context.NONE)\n    .getValue();\n\nLogsBatchQueryResult result1 = results.getResult(q1);\nLogsBatchQueryResult result2 = results.getResult(q2);\nLogsBatchQueryResult result3 = results.getResult(q3);\n\n\u002F\u002F Check for failures\nif (result3.getQueryResultStatus() == LogsQueryResultStatus.FAILURE) {\n    System.err.println(\"Query failed: \" + result3.getError().getMessage());\n}\n```\n\n### Query with Options\n\n```java\nimport com.azure.monitor.query.models.LogsQueryOptions;\nimport com.azure.core.http.rest.Response;\n\nLogsQueryOptions options = new LogsQueryOptions()\n    .setServerTimeout(Duration.ofMinutes(10))\n    .setIncludeStatistics(true)\n    .setIncludeVisualization(true);\n\nResponse\u003CLogsQueryResult> response = logsClient.queryWorkspaceWithResponse(\n    \"{workspace-id}\",\n    \"AzureActivity | summarize count() by bin(TimeGenerated, 1h)\",\n    new QueryTimeInterval(Duration.ofDays(7)),\n    options,\n    Context.NONE\n);\n\nLogsQueryResult result = response.getValue();\n\n\u002F\u002F Access statistics\nBinaryData statistics = result.getStatistics();\n\u002F\u002F Access visualization data\nBinaryData visualization = result.getVisualization();\n```\n\n### Query Multiple Workspaces\n\n```java\nimport java.util.Arrays;\n\nLogsQueryOptions options = new LogsQueryOptions()\n    .setAdditionalWorkspaces(Arrays.asList(\"{workspace-id-2}\", \"{workspace-id-3}\"));\n\nResponse\u003CLogsQueryResult> response = logsClient.queryWorkspaceWithResponse(\n    \"{workspace-id-1}\",\n    \"AzureActivity | summarize count() by TenantId\",\n    new QueryTimeInterval(Duration.ofDays(1)),\n    options,\n    Context.NONE\n);\n```\n\n## Metrics Query Operations\n\n### Basic Metrics Query\n\n```java\nimport com.azure.monitor.query.models.MetricsQueryResult;\nimport com.azure.monitor.query.models.MetricResult;\nimport com.azure.monitor.query.models.TimeSeriesElement;\nimport com.azure.monitor.query.models.MetricValue;\nimport java.util.Arrays;\n\nMetricsQueryResult result = metricsClient.queryResource(\n    \"{resource-uri}\",\n    Arrays.asList(\"SuccessfulCalls\", \"TotalCalls\")\n);\n\nfor (MetricResult metric : result.getMetrics()) {\n    System.out.println(\"Metric: \" + metric.getMetricName());\n    for (TimeSeriesElement ts : metric.getTimeSeries()) {\n        System.out.println(\"  Dimensions: \" + ts.getMetadata());\n        for (MetricValue value : ts.getValues()) {\n            System.out.println(\"    \" + value.getTimeStamp() + \": \" + value.getTotal());\n        }\n    }\n}\n```\n\n### Metrics with Aggregations\n\n```java\nimport com.azure.monitor.query.models.MetricsQueryOptions;\nimport com.azure.monitor.query.models.AggregationType;\n\nResponse\u003CMetricsQueryResult> response = metricsClient.queryResourceWithResponse(\n    \"{resource-id}\",\n    Arrays.asList(\"SuccessfulCalls\", \"TotalCalls\"),\n    new MetricsQueryOptions()\n        .setGranularity(Duration.ofHours(1))\n        .setAggregations(Arrays.asList(AggregationType.AVERAGE, AggregationType.COUNT)),\n    Context.NONE\n);\n\nMetricsQueryResult result = response.getValue();\n```\n\n### Query Multiple Resources (MetricsClient)\n\n```java\nimport com.azure.monitor.query.MetricsClient;\nimport com.azure.monitor.query.MetricsClientBuilder;\nimport com.azure.monitor.query.models.MetricsQueryResourcesResult;\n\nMetricsClient metricsClient = new MetricsClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .endpoint(\"{endpoint}\")\n    .buildClient();\n\nMetricsQueryResourcesResult result = metricsClient.queryResources(\n    Arrays.asList(\"{resourceId1}\", \"{resourceId2}\"),\n    Arrays.asList(\"{metric1}\", \"{metric2}\"),\n    \"{metricNamespace}\"\n);\n\nfor (MetricsQueryResult queryResult : result.getMetricsQueryResults()) {\n    for (MetricResult metric : queryResult.getMetrics()) {\n        System.out.println(metric.getMetricName());\n        metric.getTimeSeries().stream()\n            .flatMap(ts -> ts.getValues().stream())\n            .forEach(mv -> System.out.println(\n                mv.getTimeStamp() + \" Count=\" + mv.getCount() + \" Avg=\" + mv.getAverage()));\n    }\n}\n```\n\n## Response Structure\n\n### Logs Response Hierarchy\n\n```\nLogsQueryResult\n├── statistics (BinaryData)\n├── visualization (BinaryData)\n├── error\n└── tables (List\u003CLogsTable>)\n    ├── name\n    ├── columns (List\u003CLogsTableColumn>)\n    │   ├── name\n    │   └── type\n    └── rows (List\u003CLogsTableRow>)\n        ├── rowIndex\n        └── rowCells (List\u003CLogsTableCell>)\n```\n\n### Metrics Response Hierarchy\n\n```\nMetricsQueryResult\n├── granularity\n├── timeInterval\n├── namespace\n├── resourceRegion\n└── metrics (List\u003CMetricResult>)\n    ├── id, name, type, unit\n    └── timeSeries (List\u003CTimeSeriesElement>)\n        ├── metadata (dimensions)\n        └── values (List\u003CMetricValue>)\n            ├── timeStamp\n            ├── count, average, total\n            ├── maximum, minimum\n```\n\n## Error Handling\n\n```java\nimport com.azure.core.exception.HttpResponseException;\nimport com.azure.monitor.query.models.LogsQueryResultStatus;\n\ntry {\n    LogsQueryResult result = logsClient.queryWorkspace(workspaceId, query, timeInterval);\n    \n    \u002F\u002F Check partial failure\n    if (result.getStatus() == LogsQueryResultStatus.PARTIAL_FAILURE) {\n        System.err.println(\"Partial failure: \" + result.getError().getMessage());\n    }\n} catch (HttpResponseException e) {\n    System.err.println(\"Query failed: \" + e.getMessage());\n    System.err.println(\"Status: \" + e.getResponse().getStatusCode());\n}\n```\n\n## Best Practices\n\n1. **Use batch queries** — Combine multiple queries into a single request\n2. **Set appropriate timeouts** — Long queries may need extended server timeout\n3. **Limit result size** — Use `top` or `take` in Kusto queries\n4. **Use projections** — Select only needed columns with `project`\n5. **Check query status** — Handle PARTIAL_FAILURE results gracefully\n6. **Cache results** — Metrics don't change frequently; cache when appropriate\n7. **Migrate to new packages** — Plan migration to `azure-monitor-query-logs` and `azure-monitor-query-metrics`\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| Maven Package | https:\u002F\u002Fcentral.sonatype.com\u002Fartifact\u002Fcom.azure\u002Fazure-monitor-query |\n| GitHub | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Ftree\u002Fmain\u002Fsdk\u002Fmonitor\u002Fazure-monitor-query |\n| API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fjava\u002Fapi\u002Fcom.azure.monitor.query |\n| Kusto Query Language | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fdata-explorer\u002Fkusto\u002Fquery\u002F |\n| Log Analytics Limits | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fazure-monitor\u002Fservice-limits#la-query-api |\n| Troubleshooting | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Fblob\u002Fmain\u002Fsdk\u002Fmonitor\u002Fazure-monitor-query\u002FTROUBLESHOOTING.md |\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n","# Azure Monitor Query SDK for Java\n\n> **DEPRECATION NOTICE**: This package is deprecated in favor of:\n> - `azure-monitor-query-logs` — For Log Analytics queries\n> - `azure-monitor-query-metrics` — For metrics queries\n>\n> See migration guides: [Logs Migration](https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Fblob\u002Fmain\u002Fsdk\u002Fmonitor\u002Fazure-monitor-query-logs\u002Fmigration-guide.md) | [Metrics Migration](https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Fblob\u002Fmain\u002Fsdk\u002Fmonitor\u002Fazure-monitor-query-metrics\u002Fmigration-guide.md)\n\nClient library for querying Azure Monitor Logs and Metrics.\n\n## Installation\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>com.azure\u003C\u002FgroupId>\n    \u003CartifactId>azure-monitor-query\u003C\u002FartifactId>\n    \u003Cversion>1.5.9\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\nOr use Azure SDK BOM:\n\n```xml\n\u003CdependencyManagement>\n    \u003Cdependencies>\n        \u003Cdependency>\n            \u003CgroupId>com.azure\u003C\u002FgroupId>\n            \u003CartifactId>azure-sdk-bom\u003C\u002FartifactId>\n            \u003Cversion>{bom_version}\u003C\u002Fversion>\n            \u003Ctype>pom\u003C\u002Ftype>\n            \u003Cscope>import\u003C\u002Fscope>\n        \u003C\u002Fdependency>\n    \u003C\u002Fdependencies>\n\u003C\u002FdependencyManagement>\n\n\u003Cdependencies>\n    \u003Cdependency>\n        \u003CgroupId>com.azure\u003C\u002FgroupId>\n        \u003CartifactId>azure-monitor-query\u003C\u002FartifactId>\n    \u003C\u002Fdependency>\n\u003C\u002Fdependencies>\n```\n\n## Prerequisites\n\n- Log Analytics workspace (for logs queries)\n- Azure resource (for metrics queries)\n- TokenCredential with appropriate permissions\n\n## Environment Variables\n\n```bash\nLOG_ANALYTICS_WORKSPACE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\nAZURE_RESOURCE_ID=\u002Fsubscriptions\u002F{sub}\u002FresourceGroups\u002F{rg}\u002Fproviders\u002F{provider}\u002F{resource}\n```\n\n## Client Creation\n\n### LogsQueryClient (Sync)\n\n```java\nimport com.azure.identity.DefaultAzureCredentialBuilder;\nimport com.azure.monitor.query.LogsQueryClient;\nimport com.azure.monitor.query.LogsQueryClientBuilder;\n\nLogsQueryClient logsClient = new LogsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildClient();\n```\n\n### LogsQueryAsyncClient\n\n```java\nimport com.azure.monitor.query.LogsQueryAsyncClient;\n\nLogsQueryAsyncClient logsAsyncClient = new LogsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildAsyncClient();\n```\n\n### MetricsQueryClient (Sync)\n\n```java\nimport com.azure.monitor.query.MetricsQueryClient;\nimport com.azure.monitor.query.MetricsQueryClientBuilder;\n\nMetricsQueryClient metricsClient = new MetricsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildClient();\n```\n\n### MetricsQueryAsyncClient\n\n```java\nimport com.azure.monitor.query.MetricsQueryAsyncClient;\n\nMetricsQueryAsyncClient metricsAsyncClient = new MetricsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildAsyncClient();\n```\n\n### Sovereign Cloud Configuration\n\n```java\n\u002F\u002F Azure China Cloud - Logs\nLogsQueryClient logsClient = new LogsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .endpoint(\"https:\u002F\u002Fapi.loganalytics.azure.cn\u002Fv1\")\n    .buildClient();\n\n\u002F\u002F Azure China Cloud - Metrics\nMetricsQueryClient metricsClient = new MetricsQueryClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .endpoint(\"https:\u002F\u002Fmanagement.chinacloudapi.cn\")\n    .buildClient();\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Logs | Log and performance data from Azure resources via Kusto Query Language |\n| Metrics | Numeric time-series data collected at regular intervals |\n| Workspace ID | Log Analytics workspace identifier |\n| Resource ID | Azure resource URI for metrics queries |\n| QueryTimeInterval | Time range for the query |\n\n## Logs Query Operations\n\n### Basic Query\n\n```java\nimport com.azure.monitor.query.models.LogsQueryResult;\nimport com.azure.monitor.query.models.LogsTableRow;\nimport com.azure.monitor.query.models.QueryTimeInterval;\nimport java.time.Duration;\n\nLogsQueryResult result = logsClient.queryWorkspace(\n    \"{workspace-id}\",\n    \"AzureActivity | summarize count() by ResourceGroup | top 10 by count_\",\n    new QueryTimeInterval(Duration.ofDays(7))\n);\n\nfor (LogsTableRow row : result.getTable().getRows()) {\n    System.out.println(row.getColumnValue(\"ResourceGroup\") + \": \" + row.getColumnValue(\"count_\"));\n}\n```\n\n### Query by Resource ID\n\n```java\nLogsQueryResult result = logsClient.queryResource(\n    \"{resource-id}\",\n    \"AzureMetrics | where TimeGenerated > ago(1h)\",\n    new QueryTimeInterval(Duration.ofDays(1))\n);\n\nfor (LogsTableRow row : result.getTable().getRows()) {\n    System.out.println(row.getColumnValue(\"MetricName\") + \" \" + row.getColumnValue(\"Average\"));\n}\n```\n\n### Map Results to Custom Model\n\n```java\n\u002F\u002F Define model class\npublic class ActivityLog {\n    private String resourceGroup;\n    private String operationName;\n    \n    public String getResourceGroup() { return resourceGroup; }\n    public String getOperationName() { return operationName; }\n}\n\n\u002F\u002F Query with model mapping\nList\u003CActivityLog> logs = logsClient.queryWorkspace(\n    \"{workspace-id}\",\n    \"AzureActivity | project ResourceGroup, OperationName | take 100\",\n    new QueryTimeInterval(Duration.ofDays(2)),\n    ActivityLog.class\n);\n\nfor (ActivityLog log : logs) {\n    System.out.println(log.getOperationName() + \" - \" + log.getResourceGroup());\n}\n```\n\n### Batch Query\n\n```java\nimport com.azure.monitor.query.models.LogsBatchQuery;\nimport com.azure.monitor.query.models.LogsBatchQueryResult;\nimport com.azure.monitor.query.models.LogsBatchQueryResultCollection;\nimport com.azure.core.util.Context;\n\nLogsBatchQuery batchQuery = new LogsBatchQuery();\nString q1 = batchQuery.addWorkspaceQuery(\"{workspace-id}\", \"AzureActivity | count\", new QueryTimeInterval(Duration.ofDays(1)));\nString q2 = batchQuery.addWorkspaceQuery(\"{workspace-id}\", \"Heartbeat | count\", new QueryTimeInterval(Duration.ofDays(1)));\nString q3 = batchQuery.addWorkspaceQuery(\"{workspace-id}\", \"Perf | count\", new QueryTimeInterval(Duration.ofDays(1)));\n\nLogsBatchQueryResultCollection results = logsClient\n    .queryBatchWithResponse(batchQuery, Context.NONE)\n    .getValue();\n\nLogsBatchQueryResult result1 = results.getResult(q1);\nLogsBatchQueryResult result2 = results.getResult(q2);\nLogsBatchQueryResult result3 = results.getResult(q3);\n\n\u002F\u002F Check for failures\nif (result3.getQueryResultStatus() == LogsQueryResultStatus.FAILURE) {\n    System.err.println(\"Query failed: \" + result3.getError().getMessage());\n}\n```\n\n### Query with Options\n\n```java\nimport com.azure.monitor.query.models.LogsQueryOptions;\nimport com.azure.core.http.rest.Response;\n\nLogsQueryOptions options = new LogsQueryOptions()\n    .setServerTimeout(Duration.ofMinutes(10))\n    .setIncludeStatistics(true)\n    .setIncludeVisualization(true);\n\nResponse\u003CLogsQueryResult> response = logsClient.queryWorkspaceWithResponse(\n    \"{workspace-id}\",\n    \"AzureActivity | summarize count() by bin(TimeGenerated, 1h)\",\n    new QueryTimeInterval(Duration.ofDays(7)),\n    options,\n    Context.NONE\n);\n\nLogsQueryResult result = response.getValue();\n\n\u002F\u002F Access statistics\nBinaryData statistics = result.getStatistics();\n\u002F\u002F Access visualization data\nBinaryData visualization = result.getVisualization();\n```\n\n### Query Multiple Workspaces\n\n```java\nimport java.util.Arrays;\n\nLogsQueryOptions options = new LogsQueryOptions()\n    .setAdditionalWorkspaces(Arrays.asList(\"{workspace-id-2}\", \"{workspace-id-3}\"));\n\nResponse\u003CLogsQueryResult> response = logsClient.queryWorkspaceWithResponse(\n    \"{workspace-id-1}\",\n    \"AzureActivity | summarize count() by TenantId\",\n    new QueryTimeInterval(Duration.ofDays(1)),\n    options,\n    Context.NONE\n);\n```\n\n## Metrics Query Operations\n\n### Basic Metrics Query\n\n```java\nimport com.azure.monitor.query.models.MetricsQueryResult;\nimport com.azure.monitor.query.models.MetricResult;\nimport com.azure.monitor.query.models.TimeSeriesElement;\nimport com.azure.monitor.query.models.MetricValue;\nimport java.util.Arrays;\n\nMetricsQueryResult result = metricsClient.queryResource(\n    \"{resource-uri}\",\n    Arrays.asList(\"SuccessfulCalls\", \"TotalCalls\")\n);\n\nfor (MetricResult metric : result.getMetrics()) {\n    System.out.println(\"Metric: \" + metric.getMetricName());\n    for (TimeSeriesElement ts : metric.getTimeSeries()) {\n        System.out.println(\"  Dimensions: \" + ts.getMetadata());\n        for (MetricValue value : ts.getValues()) {\n            System.out.println(\"    \" + value.getTimeStamp() + \": \" + value.getTotal());\n        }\n    }\n}\n```\n\n### Metrics with Aggregations\n\n```java\nimport com.azure.monitor.query.models.MetricsQueryOptions;\nimport com.azure.monitor.query.models.AggregationType;\n\nResponse\u003CMetricsQueryResult> response = metricsClient.queryResourceWithResponse(\n    \"{resource-id}\",\n    Arrays.asList(\"SuccessfulCalls\", \"TotalCalls\"),\n    new MetricsQueryOptions()\n        .setGranularity(Duration.ofHours(1))\n        .setAggregations(Arrays.asList(AggregationType.AVERAGE, AggregationType.COUNT)),\n    Context.NONE\n);\n\nMetricsQueryResult result = response.getValue();\n```\n\n### Query Multiple Resources (MetricsClient)\n\n```java\nimport com.azure.monitor.query.MetricsClient;\nimport com.azure.monitor.query.MetricsClientBuilder;\nimport com.azure.monitor.query.models.MetricsQueryResourcesResult;\n\nMetricsClient metricsClient = new MetricsClientBuilder()\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .endpoint(\"{endpoint}\")\n    .buildClient();\n\nMetricsQueryResourcesResult result = metricsClient.queryResources(\n    Arrays.asList(\"{resourceId1}\", \"{resourceId2}\"),\n    Arrays.asList(\"{metric1}\", \"{metric2}\"),\n    \"{metricNamespace}\"\n);\n\nfor (MetricsQueryResult queryResult : result.getMetricsQueryResults()) {\n    for (MetricResult metric : queryResult.getMetrics()) {\n        System.out.println(metric.getMetricName());\n        metric.getTimeSeries().stream()\n            .flatMap(ts -> ts.getValues().stream())\n            .forEach(mv -> System.out.println(\n                mv.getTimeStamp() + \" Count=\" + mv.getCount() + \" Avg=\" + mv.getAverage()));\n    }\n}\n```\n\n## Response Structure\n\n### Logs Response Hierarchy\n\n```\nLogsQueryResult\n├── statistics (BinaryData)\n├── visualization (BinaryData)\n├── error\n└── tables (List\u003CLogsTable>)\n    ├── name\n    ├── columns (List\u003CLogsTableColumn>)\n    │   ├── name\n    │   └── type\n    └── rows (List\u003CLogsTableRow>)\n        ├── rowIndex\n        └── rowCells (List\u003CLogsTableCell>)\n```\n\n### Metrics Response Hierarchy\n\n```\nMetricsQueryResult\n├── granularity\n├── timeInterval\n├── namespace\n├── resourceRegion\n└── metrics (List\u003CMetricResult>)\n    ├── id, name, type, unit\n    └── timeSeries (List\u003CTimeSeriesElement>)\n        ├── metadata (dimensions)\n        └── values (List\u003CMetricValue>)\n            ├── timeStamp\n            ├── count, average, total\n            ├── maximum, minimum\n```\n\n## Error Handling\n\n```java\nimport com.azure.core.exception.HttpResponseException;\nimport com.azure.monitor.query.models.LogsQueryResultStatus;\n\ntry {\n    LogsQueryResult result = logsClient.queryWorkspace(workspaceId, query, timeInterval);\n    \n    \u002F\u002F Check partial failure\n    if (result.getStatus() == LogsQueryResultStatus.PARTIAL_FAILURE) {\n        System.err.println(\"Partial failure: \" + result.getError().getMessage());\n    }\n} catch (HttpResponseException e) {\n    System.err.println(\"Query failed: \" + e.getMessage());\n    System.err.println(\"Status: \" + e.getResponse().getStatusCode());\n}\n```\n\n## Best Practices\n\n1. **Use batch queries** — Combine multiple queries into a single request\n2. **Set appropriate timeouts** — Long queries may need extended server timeout\n3. **Limit result size** — Use `top` or `take` in Kusto queries\n4. **Use projections** — Select only needed columns with `project`\n5. **Check query status** — Handle PARTIAL_FAILURE results gracefully\n6. **Cache results** — Metrics don't change frequently; cache when appropriate\n7. **Migrate to new packages** — Plan migration to `azure-monitor-query-logs` and `azure-monitor-query-metrics`\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| Maven Package | https:\u002F\u002Fcentral.sonatype.com\u002Fartifact\u002Fcom.azure\u002Fazure-monitor-query |\n| GitHub | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Ftree\u002Fmain\u002Fsdk\u002Fmonitor\u002Fazure-monitor-query |\n| API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fjava\u002Fapi\u002Fcom.azure.monitor.query |\n| Kusto Query Language | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fdata-explorer\u002Fkusto\u002Fquery\u002F |\n| Log Analytics Limits | https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fazure-monitor\u002Fservice-limits#la-query-api |\n| Troubleshooting | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Fblob\u002Fmain\u002Fsdk\u002Fmonitor\u002Fazure-monitor-query\u002FTROUBLESHOOTING.md |\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n",{},"release\u002Fv4.2.11-panel-pro","a92ea02bcf7e2b3dbaf46d49696c29a3cb490d4f",".github\u002Fskills\u002Fazure-monitor-query-java","https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-","https:\u002F\u002Fgithub.com\u002Fjaviertarazon","2026-07-12 07:10:45",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add javiertarazon\u002Fide-agente-free-jt7- --skill azure-monitor-query-java",{"tool":40,"command":41},"bunx","bunx skills add javiertarazon\u002Fide-agente-free-jt7- --skill azure-monitor-query-java",{"tool":43,"command":44},"pnpm","pnpm dlx skills add javiertarazon\u002Fide-agente-free-jt7- --skill azure-monitor-query-java","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-\u002Fblob\u002Frelease\u002Fv4.2.11-panel-pro\u002F.github\u002Fskills\u002Fazure-monitor-query-java\u002FSKILL.md",true,[],[49,81,108,128,143,165],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":60,"publishedAt":23},"01M71TQ7Q6Z10VWF3C2H5X1KW9","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reacti...","https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-\u002Fblob\u002Frelease\u002Fv4.2.11-panel-pro\u002F.github\u002Fskills\u002Fzustand-store-ts\u002FSKILL.md",[55],{"categoryNo":56,"categoryName":57,"taxonomyType":58,"taxonomyTypeDesc":59},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],"zustand","store","zustand store ts","community","middleware","implementing","use","react state management","when","unknown","react","with","state","create","state management","typescript","action","management","separation","global",{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":90,"publishedAt":23},"01M71TQ5EAR40G6W0MV5ZDVEZT","zoom-automation","Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.","https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-\u002Fblob\u002Frelease\u002Fv4.2.11-panel-pro\u002F.github\u002Fskills\u002Fzoom-automation\u002FSKILL.md",[87],{"categoryNo":88,"categoryName":89,"taxonomyType":58,"taxonomyTypeDesc":59},"01JBSEEDCAT000000000000023","Skill与智能体开发",[91,92,93,64,94,95,96,97,98,70,99,100,101,102,103,104,105,106,78,107],"zoom automation","zoom","automation","creation","for","search","schemas","MCP","first","via","meeting","search tools","tracking","webinars","composio","recordings","Tools",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":115,"publishedAt":23},"01M71TQ29B1EYBCEAP1ZBGXQ1A","zoho-crm-automation","Automate Zoho CRM tasks via Rube MCP (Composio): create\u002Fupdate records, search contacts, manage leads, and convert leads. Always search tools first for current schemas.","https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-\u002Fblob\u002Frelease\u002Fv4.2.11-panel-pro\u002F.github\u002Fskills\u002Fzoho-crm-automation\u002FSKILL.md",[114],{"categoryNo":88,"categoryName":89,"taxonomyType":58,"taxonomyTypeDesc":59},[116,117,93,118,119,120,64,121,122,95,123,96,97,124,98,70,125,126,127,74],"crm automation","zoho crm automation","crm","zoho crm","zoho","leads","manage leads","manage","records","convert","tasks","contacts",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":135,"publishedAt":23},"01M71TPZPMN60DH0XV58KVHY23","zendesk-automation","Automate Zendesk tasks via Rube MCP (Composio): tickets, users, organizations, replies. Always search tools first for current schemas.","https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-\u002Fblob\u002Frelease\u002Fv4.2.11-panel-pro\u002F.github\u002Fskills\u002Fzendesk-automation\u002FSKILL.md",[134],{"categoryNo":88,"categoryName":89,"taxonomyType":58,"taxonomyTypeDesc":59},[136,93,137,64,95,96,97,98,138,70,126,139,140,99,100,141,102,105,107,142],"zendesk automation","zendesk","organizations","replies","users","tickets","automate",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":23},"01M71TPXDWKHKG4N6TVEPXWD0N","zapier-make-patterns","No-code automation democratizes workflow building. Zapier and Make (formerly Integromat) let non-developers automate business processes without writing code. But no-code doesn't mean no-complexity ...","https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-\u002Fblob\u002Frelease\u002Fv4.2.11-panel-pro\u002F.github\u002Fskills\u002Fzapier-make-patterns\u002FSKILL.md",[],[150,151,152,153,154,155,156,157,158,93,159,70,160,161,162,163,164,142],"zapier make patterns","zapier","patterns","make","No-Code","complexity","writing","spawner","business","workflow","code","integromat","apache","processes","but",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":174,"publishedAt":23},"01M71TPT5T10WXNKW9G7ZXZ27W","youtube-summarizer","Extract transcripts from YouTube videos and generate comprehensive, detailed summaries using intelligent analysis frameworks","https:\u002F\u002Fgithub.com\u002Fjaviertarazon\u002Fide-agente-free-jt7-\u002Fblob\u002Frelease\u002Fv4.2.11-panel-pro\u002F.github\u002Fskills\u002Fyoutube-summarizer\u002FSKILL.md",[171],{"categoryNo":172,"categoryName":173,"taxonomyType":58,"taxonomyTypeDesc":59},"01JBSEEDCAT000000000000016","图像与多媒体",[175,176,177,178,64,179,180,181,182,183,184,185,160,186,187,188,189,190,191,192],"summarizer","youtube","youtube summarizer","Video","content-analysis","frameworks","copilot","2025","github-copilot","extract transcripts","analysis","codex","cli","summaries","github","generate","summarization","2026"]