From faf0d80c8ab51d1c2ef2cf84f2168cb6d7a77a10 Mon Sep 17 00:00:00 2001 From: Vinay Gera Date: Wed, 24 Jan 2024 11:09:23 -0800 Subject: [PATCH 1/4] add javdocs for monitor query --- .../monitor/query/LogsQueryAsyncClient.java | 8 +- .../azure/monitor/query/LogsQueryClient.java | 7 +- .../com/azure/monitor/query/package-info.java | 122 +++++++++++++++++- 3 files changed, 134 insertions(+), 3 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java index 360cf0fa21c4..91f33f3e4f52 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java @@ -37,7 +37,10 @@ import static com.azure.monitor.query.implementation.logs.models.LogsQueryHelper.mapLogsQueryError; /** - * The asynchronous client for querying Azure Monitor logs. + *

The LogsQueryClient is an asynchronous client that provides methods to execute Kusto queries against + * Azure Monitor logs. It provides methods to query logs in a specific workspace, execute a batch of queries, and + * query logs for a specific Azure resource.

+ * *

Instantiating an asynchronous Logs query Client

* * @@ -47,6 +50,9 @@ * .buildAsyncClient(); * * + * + * @see com.azure.monitor.query + * @see LogsQueryClientBuilder */ @ServiceClient(builder = LogsQueryClientBuilder.class, isAsync = true) public final class LogsQueryAsyncClient { diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java index 08b73749048f..a53d08dcdd39 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java @@ -35,7 +35,9 @@ import static com.azure.monitor.query.implementation.logs.models.LogsQueryHelper.updateContext; /** - * The synchronous client for querying Azure Monitor logs. + *

The LogsQueryClient is a synchronous client that provides methods to execute Kusto queries against + * Azure Monitor logs. It provides methods to query logs in a specific workspace, execute a batch of queries, and + * query logs for a specific Azure resource.

* *

Instantiating a synchronous Logs query Client

* @@ -46,6 +48,9 @@ * .buildClient(); * * + * + * @see com.azure.monitor.query + * @see LogsQueryClientBuilder */ @ServiceClient(builder = LogsQueryClientBuilder.class) public final class LogsQueryClient { diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/package-info.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/package-info.java index d4471509d853..80be3b62d5e0 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/package-info.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/package-info.java @@ -2,6 +2,126 @@ // Licensed under the MIT License. /** - * Package containing clients for querying logs and metrics from Azure Monitor. + *

Azure Monitor Query service is a powerful tool that allows you to query and analyze log data from various sources + * in Azure. It is built on top of the Kusto Query Language (KQL), which is a powerful query language that allows you + * to perform complex queries on large datasets. With Azure Monitor Query, you can easily search and analyze + * log data from various sources, including virtual machines, containers, and applications.

+ * + *

Azure Monitor Query java client library is a library that allows you to execute read-only queries against + * Azure Monitor’s two data platforms: Logs and Metrics. The library provides both synchronous and asynchronous forms + * of the clients.

+ * + * + * + *

Getting Started

+ * + *

In order to interact with the Monitor service you'll need to create an instance of the + * {@link com.azure.monitor.query.LogsQueryClient} or {@link com.azure.monitor.query.MetricsQueryClient} class. To make + * this possible you'll need to use AAD authentication via + * Azure Identity + * to connect to the service.

+ * + *
    + *
  1. Azure Active Directory for Logs Query Client, see {@link com.azure.monitor.query.LogsQueryClientBuilder#credential(com.azure.core.credential.TokenCredential) TokenCredential}.
  2. + *
  3. Azure Active Directory for Metrics Query Client, see {@link com.azure.monitor.query.MetricsQueryClientBuilder#credential(com.azure.core.credential.TokenCredential) TokenCredential}.
  4. + *
+ * + *

Sample: Construct Asynchronous Clients

+ * + *

The following code sample demonstrates the creation of a {@link com.azure.monitor.query.LogsQueryAsyncClient} + * using the {@link com.azure.monitor.query.LogsQueryClientBuilder}.

+ * + * + *
+ * LogsQueryAsyncClient logsQueryAsyncClient = new LogsQueryClientBuilder()
+ *         .credential(tokenCredential)
+ *         .buildAsyncClient();
+ * 
+ * + * + *

The following code sample demonstrates the creation of a {@link com.azure.monitor.query.MetricsQueryAsyncClient} + * using the {@link com.azure.monitor.query.MetricsQueryClientBuilder}.

+ * + * + *
+ * MetricsQueryAsyncClient metricsQueryAsyncClient = new MetricsQueryClientBuilder()
+ *         .credential(tokenCredential)
+ *         .buildAsyncClient();
+ * 
+ * + * + *

Sample: Construct Synchronous Clients

+ * + *

The following code sample demonstrates the creation of a {@link com.azure.monitor.query.LogsQueryClient} + * using the {@link com.azure.monitor.query.LogsQueryClientBuilder}.

+ * + * + *
+ * LogsQueryClient logsQueryClient = new LogsQueryClientBuilder()
+ *         .credential(tokenCredential)
+ *         .buildClient();
+ * 
+ * + * + *

The following code sample demonstrates the creation of a {@link com.azure.monitor.query.MetricsQueryClient} + * using the {@link com.azure.monitor.query.MetricsQueryClientBuilder}.

+ * + * + *
+ * MetricsQueryClient metricsQueryClient = new MetricsQueryClientBuilder()
+ *         .credential(tokenCredential)
+ *         .buildClient();
+ * 
+ * + * + *
+ * + *
+ * + *

Query Workspace

+ * + *

The {@link com.azure.monitor.query.LogsQueryClient#queryWorkspace(java.lang.String, java.lang.String, com.azure.monitor.query.models.QueryTimeInterval) Query Workspace API} method can be used to + * query logs from a given workspace.

+ * + *

The sample below shows how to query logs from the last 24 hours

+ * + * + *
+ * LogsQueryResult queryResult = logsQueryClient.queryWorkspace("{workspace-id}", "{kusto-query}",
+ *         QueryTimeInterval.LAST_DAY);
+ * for (LogsTableRow row : queryResult.getTable().getRows()) {
+ *     System.out.println(row.getRow()
+ *             .stream()
+ *             .map(LogsTableCell::getValueAsString)
+ *             .collect(Collectors.joining(",")));
+ * }
+ * 
+ * + * + * + *

Note: For asynchronous sample, refer to {@link com.azure.monitor.query.LogsQueryAsyncClient#queryWorkspace(java.lang.String, java.lang.String, com.azure.monitor.query.models.QueryTimeInterval)}.

+ * + *
+ * + *
+ * + * @see com.azure.monitor.query.LogsQueryClientBuilder + * @see com.azure.monitor.query.LogsQueryClient + * @see com.azure.monitor.query.LogsQueryAsyncClient + * @see com.azure.monitor.query.MetricsQueryClientBuilder + * @see com.azure.monitor.query.MetricsQueryClient + * @see com.azure.monitor.query.MetricsQueryAsyncClient */ package com.azure.monitor.query; From d373dddd5554a467ad8eba69fb455bc2efe3dd34 Mon Sep 17 00:00:00 2001 From: Jair Myree Date: Wed, 6 Mar 2024 09:25:08 -0800 Subject: [PATCH 2/4] PR updates for monitor query javadocs --- .../monitor/query/LogsQueryAsyncClient.java | 38 ++++++++++++++++++- .../azure/monitor/query/LogsQueryClient.java | 38 ++++++++++++++++++- .../monitor/query/LogsQueryClientBuilder.java | 29 +++++++++++++- .../query/MetricsQueryAsyncClient.java | 34 ++++++++++++++++- .../monitor/query/MetricsQueryClient.java | 34 ++++++++++++++++- .../query/MetricsQueryClientBuilder.java | 35 ++++++++++++++++- 6 files changed, 200 insertions(+), 8 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java index 91f33f3e4f52..bdaa906e9478 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java @@ -37,11 +37,18 @@ import static com.azure.monitor.query.implementation.logs.models.LogsQueryHelper.mapLogsQueryError; /** + * Provides an asynchronous service client for querying logs in the Azure Monitor Service. + * + *

Overview

+ * *

The LogsQueryClient is an asynchronous client that provides methods to execute Kusto queries against * Azure Monitor logs. It provides methods to query logs in a specific workspace, execute a batch of queries, and * query logs for a specific Azure resource.

* - *

Instantiating an asynchronous Logs query Client

+ *

Getting Started

+ * + *

Authenticating and building instances of this client are handled by {@link LogsQueryClientBuilder}. + * This sample shows how to authenticate and build a LogQueryAsyncClient instance using LogQueryClientBuilder.

* * *
@@ -51,6 +58,35 @@
  * 
* * + *

For more information on building and authenticating, see the {@link LogsQueryClientBuilder} documentation.

+ * + *

Client Usage

+ * + *

+ * For more information on how to use this client, see the following method documentation: + *

+ * + * + * * @see com.azure.monitor.query * @see LogsQueryClientBuilder */ diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java index a53d08dcdd39..5e08d5bd6ed7 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java @@ -35,11 +35,18 @@ import static com.azure.monitor.query.implementation.logs.models.LogsQueryHelper.updateContext; /** + * Provides a synchronous service client for querying logs in the Azure Monitor Service. + * + *

Overview

+ * *

The LogsQueryClient is a synchronous client that provides methods to execute Kusto queries against * Azure Monitor logs. It provides methods to query logs in a specific workspace, execute a batch of queries, and * query logs for a specific Azure resource.

* - *

Instantiating a synchronous Logs query Client

+ *

Getting Started

+ * + *

Authenticating and building instances of this client are handled by {@link LogsQueryClientBuilder}. + * his sample shows how to authenticate and build a LogsQueryClient instance using LogQueryClientBuilder.

* * *
@@ -49,6 +56,35 @@
  * 
* * + *

For more information on building and authenticating, see the {@link LogsQueryClientBuilder} documentation.

+ * + *

Client Usage

+ * + *

+ * For more information on how to use this client, see the following method documentation: + *

+ * + * + * * @see com.azure.monitor.query * @see LogsQueryClientBuilder */ diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClientBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClientBuilder.java index 5859275c1317..822ec3548493 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClientBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClientBuilder.java @@ -23,7 +23,23 @@ /** * Fluent builder for creating instances of {@link LogsQueryClient} and {@link LogsQueryAsyncClient}. * - *

Instantiating an asynchronous Logs query Client

+ *

Overview

+ * + *

The LogsQueryClientBuilder is responsible for authenticating a building instances of {@link LogsQueryClient} and + * {@link LogsQueryAsyncClient}. Customizations can be applied to clients through the builder using the various options + * available.

+ * + *

Getting Started

+ * + *

+ * To create instances of the clients, sufficient authentication credentials are required. {@link TokenCredential} is + * a common form of authentication. The resource / workspace is not required for client creation, but the authentication + * credentials must have access to the resources / workspaces utilized by the client. + *

+ * + *

Client Builder Usage

+ * + *

The following sample shows instantiating an asynchronous Logs query Client using Token Credential

* * *
@@ -33,7 +49,7 @@
  * 
* * - *

Instantiating a synchronous Logs query Client

+ *

The following sample shows instantiating a synchronous Logs query Client using Token Credential

* * *
@@ -42,6 +58,15 @@
  *         .buildClient();
  * 
* + * + *

+ * For more information about the other types of credentials that can be used to authenticate your client, please see + * this documentation: Azure Identity + *

+ * + * @see com.azure.monitor.query + * @see LogsQueryClient + * @see LogsQueryAsyncClient */ @ServiceClientBuilder(serviceClients = {LogsQueryClient.class, LogsQueryAsyncClient.class}) public final class LogsQueryClientBuilder implements EndpointTrait, diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryAsyncClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryAsyncClient.java index 5b29996843e7..b0641e3fabfd 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryAsyncClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryAsyncClient.java @@ -34,7 +34,20 @@ /** * The asynchronous client for querying Azure Monitor metrics. - *

Instantiating an asynchronous Metrics query Client

+ * + *

Overview

+ * + *

Azure Monitor Metrics is a feature of Azure Monitor that collects numeric data from monitored resources into a + * time-series database. Metrics are numerical values that are collected at regular intervals and describe some aspect + * of a system at a particular time. The MetricsQueryClient provides synchronous implementations of methods that query + * metrics from your Azure services.

+ * + *

Getting Started

+ * + *

+ * Authenticating and building MetricsQueryAsyncClient instances are done through {@link MetricsQueryClientBuilder}. + * The following sample shows how to build a new MetricsQueryClient instance. + *

* * *
@@ -43,6 +56,25 @@
  *         .buildAsyncClient();
  * 
* + * + *

+ * For more information on building and authenticating, see the {@link MetricsQueryClientBuilder} documentation. + *

+ * + *

Client Usage

+ * + *

+ * For more information on using the MetricsQueryAsyncClient, see the following method documentation: + *

+ * + *
    + *
  • + * {@link MetricsQueryAsyncClient#queryResource(String, List)} - Query metrics for an Azure resource. + *
  • + *
+ * + * @see com.azure.monitor.query + * @see MetricsQueryClientBuilder */ @ServiceClient(builder = MetricsQueryClientBuilder.class, isAsync = true) public final class MetricsQueryAsyncClient { diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java index 54c4d40df9b9..283f553b7a53 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java @@ -35,7 +35,20 @@ /** * The synchronous client for querying Azure Monitor metrics. * - *

Instantiating a synchronous Metrics query Client

+ *

Overview

+ * + *

Azure Monitor Metrics is a feature of Azure Monitor that collects numeric data from monitored resources into a + * time-series database. Metrics are numerical values that are collected at regular intervals and describe some aspect + * of a system at a particular time. The MetricsQueryClient provides synchronous implementations of methods that query + * metrics from your Azure services.

+ * + *

Getting Started

+ * + *

+ * Authenticating and building MetricsQueryClient instances are done through {@link MetricsQueryClientBuilder}. + * The following sample shows how to build a new MetricsQueryClient instance. + *

+ * * *
  * MetricsQueryClient metricsQueryClient = new MetricsQueryClientBuilder()
@@ -43,6 +56,25 @@
  *         .buildClient();
  * 
* + * + *

+ * For more information on building and authenticating, see the {@link MetricsQueryClientBuilder} documentation. + *

+ * + *

Client Usage

+ * + *

+ * For more information on using the MetricsQueryClient, see the following method documentation: + *

+ * + *
    + *
  • + * {@link MetricsQueryClient#queryResource(String, List)} - Query metrics for an Azure resource. + *
  • + *
+ * + * @see com.azure.monitor.query + * @see MetricsQueryClientBuilder */ @ServiceClient(builder = MetricsQueryClientBuilder.class) public final class MetricsQueryClient { diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClientBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClientBuilder.java index c9227ecfae53..4f3896e0a642 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClientBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClientBuilder.java @@ -26,7 +26,27 @@ /** * Fluent builder for creating instances of {@link MetricsQueryClient} and {@link MetricsQueryAsyncClient}. * - *

Instantiating an asynchronous Metrics query Client

+ *

Overview

+ * + *

+ * The MetricsQueryClientBuilder is responsible for authenticating a building instances of {@link MetricsQueryClient} and + * {@link MetricsQueryAsyncClient}. Customizations can be applied to clients through the builder using the various options + * available. + *

+ * + *

Getting Started

+ * + *

+ * To create instances of the clients, sufficient authentication credentials are required. {@link TokenCredential} is + * a common form of authentication. The resource / workspace is not required for client creation, but the authentication + * credentials must have access to the resources / workspaces utilized by the client. + *

+ * + *

Client Builder Usage

+ * + *

+ * The following sample shows instantiating an asynchronous Metrics query Client using Token Credential + *

* * *
@@ -36,7 +56,9 @@
  * 
* * - *

Instantiating a synchronous Metrics query Client

+ *

+ * The following sample shows instantiating a synchronous Metrics query Client using Token Credential + *

* * *
@@ -45,6 +67,15 @@
  *         .buildClient();
  * 
* + * + *

+ * For more information about the other types of credentials that can be used to authenticate your client, please see + * this documentation: Azure Identity + *

+ * + * @see com.azure.monitor.query + * @see MetricsQueryClient + * @see MetricsQueryAsyncClient */ @ServiceClientBuilder(serviceClients = {MetricsQueryClient.class, MetricsQueryAsyncClient.class}) public final class MetricsQueryClientBuilder implements EndpointTrait, From 76d57078a03e175c3aa31449e7d13a9dd489aba0 Mon Sep 17 00:00:00 2001 From: Vinay Gera Date: Wed, 20 Mar 2024 13:18:17 -0700 Subject: [PATCH 3/4] update javadocs --- .../com/azure/monitor/query/LogsQueryAsyncClient.java | 4 +--- .../java/com/azure/monitor/query/LogsQueryClient.java | 4 +--- .../azure/monitor/query/LogsQueryClientBuilder.java | 9 ++++++--- .../monitor/query/MetricsBatchQueryClientBuilder.java | 5 +++++ .../azure/monitor/query/MetricsQueryAsyncClient.java | 6 +++--- .../com/azure/monitor/query/MetricsQueryClient.java | 6 +++--- .../monitor/query/MetricsQueryClientBuilder.java | 9 ++++++--- .../azure/monitor/query/models/LogsBatchQuery.java | 5 +++++ .../azure/monitor/query/models/LogsColumnType.java | 11 ++++++++++- .../azure/monitor/query/models/LogsQueryOptions.java | 5 +++++ .../monitor/query/models/MetricAvailability.java | 5 +++++ .../com/azure/monitor/query/models/MetricClass.java | 11 ++++++++++- .../azure/monitor/query/models/MetricDefinition.java | 5 +++++ .../azure/monitor/query/models/MetricNamespace.java | 5 +++++ .../com/azure/monitor/query/models/MetricUnit.java | 11 ++++++++++- .../query/models/MetricsBatchQueryOptions.java | 4 ++++ .../monitor/query/models/MetricsQueryOptions.java | 5 +++++ .../monitor/query/models/NamespaceClassification.java | 11 ++++++++++- .../java/com/azure/monitor/query/package-info.java | 9 ++------- 19 files changed, 101 insertions(+), 29 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java index bdaa906e9478..1a56141c4720 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryAsyncClient.java @@ -37,9 +37,7 @@ import static com.azure.monitor.query.implementation.logs.models.LogsQueryHelper.mapLogsQueryError; /** - * Provides an asynchronous service client for querying logs in the Azure Monitor Service. - * - *

Overview

+ *

Provides an asynchronous service client for querying logs in the Azure Monitor Service.

* *

The LogsQueryClient is an asynchronous client that provides methods to execute Kusto queries against * Azure Monitor logs. It provides methods to query logs in a specific workspace, execute a batch of queries, and diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java index 5e08d5bd6ed7..06595ff25426 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClient.java @@ -35,9 +35,7 @@ import static com.azure.monitor.query.implementation.logs.models.LogsQueryHelper.updateContext; /** - * Provides a synchronous service client for querying logs in the Azure Monitor Service. - * - *

Overview

+ *

Provides a synchronous service client for querying logs in the Azure Monitor Service.

* *

The LogsQueryClient is a synchronous client that provides methods to execute Kusto queries against * Azure Monitor logs. It provides methods to query logs in a specific workspace, execute a batch of queries, and diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClientBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClientBuilder.java index 822ec3548493..2bc4e72086af 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClientBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/LogsQueryClientBuilder.java @@ -21,9 +21,7 @@ import com.azure.monitor.query.implementation.logs.AzureLogAnalyticsImplBuilder; /** - * Fluent builder for creating instances of {@link LogsQueryClient} and {@link LogsQueryAsyncClient}. - * - *

Overview

+ *

Fluent builder for creating instances of {@link LogsQueryClient} and {@link LogsQueryAsyncClient}.

* *

The LogsQueryClientBuilder is responsible for authenticating a building instances of {@link LogsQueryClient} and * {@link LogsQueryAsyncClient}. Customizations can be applied to clients through the builder using the various options @@ -75,6 +73,11 @@ public final class LogsQueryClientBuilder implements EndpointTraitOverview + *

The asynchronous client for querying Azure Monitor metrics.

* *

Azure Monitor Metrics is a feature of Azure Monitor that collects numeric data from monitored resources into a * time-series database. Metrics are numerical values that are collected at regular intervals and describe some aspect @@ -70,6 +68,8 @@ *

    *
  • * {@link MetricsQueryAsyncClient#queryResource(String, List)} - Query metrics for an Azure resource. + * {@link MetricsQueryAsyncClient#listMetricNamespaces(String, OffsetDateTime)} - Lists all the metrics namespaces created for the resource URI. + * {@link MetricsQueryAsyncClient#listMetricDefinitions(String)} - Lists all the metrics definitions created for the resource URI. *
  • *
* diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java index 283f553b7a53..cf0b59124620 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java @@ -33,9 +33,7 @@ import static com.azure.monitor.query.implementation.metrics.models.MetricsHelper.convertToMetricsQueryResult; /** - * The synchronous client for querying Azure Monitor metrics. - * - *

Overview

+ *

The synchronous client for querying Azure Monitor metrics.

* *

Azure Monitor Metrics is a feature of Azure Monitor that collects numeric data from monitored resources into a * time-series database. Metrics are numerical values that are collected at regular intervals and describe some aspect @@ -70,6 +68,8 @@ *

    *
  • * {@link MetricsQueryClient#queryResource(String, List)} - Query metrics for an Azure resource. + * {@link MetricsQueryClient#listMetricNamespaces(String, OffsetDateTime)} - Lists all the metrics namespaces created for the resource URI. + * {@link MetricsQueryClient#listMetricDefinitions(String)} - Lists all the metrics definitions created for the resource URI. *
  • *
* diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClientBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClientBuilder.java index 4f3896e0a642..be8a683be297 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClientBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClientBuilder.java @@ -24,9 +24,7 @@ import com.azure.monitor.query.implementation.metricsnamespaces.MetricsNamespacesClientImplBuilder; /** - * Fluent builder for creating instances of {@link MetricsQueryClient} and {@link MetricsQueryAsyncClient}. - * - *

Overview

+ *

Fluent builder for creating instances of {@link MetricsQueryClient} and {@link MetricsQueryAsyncClient}.

* *

* The MetricsQueryClientBuilder is responsible for authenticating a building instances of {@link MetricsQueryClient} and @@ -91,6 +89,11 @@ public final class MetricsQueryClientBuilder implements EndpointTrait { /** Static value timespan for LogsColumnType. */ public static final LogsColumnType TIMESPAN = fromString("timespan"); + /** + * Creates an instance of LogsColumnType. + */ + public LogsColumnType() { } + /** * Creates or finds a LogsColumnType from its string representation. * @@ -50,7 +55,11 @@ public static LogsColumnType fromString(String name) { return fromString(name, LogsColumnType.class); } - /** @return known LogsColumnType values. */ + /** + * Returns known LogsColumnType values. + * + * @return The {@link Collection} of known LogsColumnType values. + */ public static Collection values() { return values(LogsColumnType.class); } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/LogsQueryOptions.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/LogsQueryOptions.java index fe1487c452d1..a560793d0824 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/LogsQueryOptions.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/LogsQueryOptions.java @@ -20,6 +20,11 @@ public final class LogsQueryOptions { private Duration serverTimeout; private List additionalWorkspaces; + /** + * Creates an instance of LogsQueryOptions. + */ + public LogsQueryOptions() { } + /** * Returns the server timeout for this query. * @return The server timeout duration. diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricAvailability.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricAvailability.java index 8d875fd77378..75037bb2d7a9 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricAvailability.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricAvailability.java @@ -19,6 +19,11 @@ public final class MetricAvailability { MetricsHelper.setMetricAvailabilityAccessor(MetricAvailability::setMetricAvailabilityProperties); } + /** + * Creates an instance of MetricAvailability. + */ + public MetricAvailability() { } + private void setMetricAvailabilityProperties(Duration retention, Duration granularity) { this.retention = retention; this.granularity = granularity; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricClass.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricClass.java index 15010f5b9a7b..7916fe8762d7 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricClass.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricClass.java @@ -24,6 +24,11 @@ public final class MetricClass extends ExpandableStringEnum { /** Static value Saturation for MetricClass. */ public static final MetricClass SATURATION = fromString("Saturation"); + /** + * Creates an instance of MetricClass. + */ + public MetricClass() { } + /** * Creates or finds a MetricClass from its string representation. * @@ -35,7 +40,11 @@ public static MetricClass fromString(String name) { return fromString(name, MetricClass.class); } - /** @return known MetricClass values. */ + /** + * Returns the known MetricClass values. + * + * @return The {@link Collection} of known MetricClass values. + */ public static Collection values() { return values(MetricClass.class); } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricDefinition.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricDefinition.java index afa2531e88d5..6256a24c8631 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricDefinition.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricDefinition.java @@ -30,6 +30,11 @@ public final class MetricDefinition { MetricsHelper.setMetricDefinitionAccessor(MetricDefinition::setMetricDefinitionProperties); } + /** + * Creates an instance of MetricDefinition. + */ + public MetricDefinition() { } + private void setMetricDefinitionProperties(Boolean dimensionRequired, String resourceId, String namespace, diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricNamespace.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricNamespace.java index 50ce62705640..93bb1ee5c10e 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricNamespace.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricNamespace.java @@ -19,6 +19,11 @@ public final class MetricNamespace { MetricsHelper.setMetricNamespaceAccessor(MetricNamespace::setMetricNamespaceProperties); } + /** + * Creates an instance of MetricNamespace. + */ + public MetricNamespace() { } + private void setMetricNamespaceProperties(NamespaceClassification classification, String id, String name, String fullyQualifiedName, String type) { this.classification = classification; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricUnit.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricUnit.java index 699088b6dc8a..34d07f49fb61 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricUnit.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricUnit.java @@ -48,6 +48,11 @@ public final class MetricUnit extends ExpandableStringEnum { /** Static value BitsPerSecond for MetricUnit. */ public static final MetricUnit BITS_PER_SECOND = fromString("BitsPerSecond"); + /** + * Creates an instance of MetricUnit. + */ + public MetricUnit() { } + /** * Creates or finds a MetricUnit from its string representation. * @@ -59,7 +64,11 @@ public static MetricUnit fromString(String name) { return fromString(name, MetricUnit.class); } - /** @return known MetricUnit values. */ + /** + * Returns the known MetricUnit values. + * + * @return The {@link Collection} of known MetricUnit values. + */ public static Collection values() { return values(MetricUnit.class); } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsBatchQueryOptions.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsBatchQueryOptions.java index d3470a871eff..735374ef9259 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsBatchQueryOptions.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsBatchQueryOptions.java @@ -20,6 +20,10 @@ public final class MetricsBatchQueryOptions { private String orderBy; private String filter; + /** + * Creates an instance of MetricsBatchQueryOptions. + */ + public MetricsBatchQueryOptions() { } /** * Returns the time span for which the metrics data is queried. diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsQueryOptions.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsQueryOptions.java index 57d6eed36194..75f7af9c279e 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsQueryOptions.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsQueryOptions.java @@ -22,6 +22,11 @@ public final class MetricsQueryOptions { private String filter; private String metricNamespace; + /** + * Creates an instance of MetricsQueryOptions. + */ + public MetricsQueryOptions() { } + /** * Returns the time span for which the metrics data is queried. * @return the time span for which the metrics data is queried. diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/NamespaceClassification.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/NamespaceClassification.java index e366de2d3c57..f94469cf9f6f 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/NamespaceClassification.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/NamespaceClassification.java @@ -18,6 +18,11 @@ public final class NamespaceClassification extends ExpandableStringEnum values() { return values(NamespaceClassification.class); } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/package-info.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/package-info.java index 80be3b62d5e0..6f5ecd316e98 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/package-info.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/package-info.java @@ -18,7 +18,7 @@ * apps can be consolidated into a single Azure Log Analytics workspace. * The various data types can be analyzed together using the Kusto Query Language. * - *

  • - Collects + *
  • Metrics - Collects * numeric data from monitored resources into a time series database. Metrics are numerical values that are * collected at regular intervals and describe some aspect of a system at a particular time. Metrics are lightweight * and capable of supporting near real-time scenarios, making them particularly useful for alerting and fast @@ -33,11 +33,6 @@ * Azure Identity * to connect to the service.

    * - *
      - *
    1. Azure Active Directory for Logs Query Client, see {@link com.azure.monitor.query.LogsQueryClientBuilder#credential(com.azure.core.credential.TokenCredential) TokenCredential}.
    2. - *
    3. Azure Active Directory for Metrics Query Client, see {@link com.azure.monitor.query.MetricsQueryClientBuilder#credential(com.azure.core.credential.TokenCredential) TokenCredential}.
    4. - *
    - * *

    Sample: Construct Asynchronous Clients

    * *

    The following code sample demonstrates the creation of a {@link com.azure.monitor.query.LogsQueryAsyncClient} @@ -111,7 +106,7 @@ * * * - *

    Note: For asynchronous sample, refer to {@link com.azure.monitor.query.LogsQueryAsyncClient#queryWorkspace(java.lang.String, java.lang.String, com.azure.monitor.query.models.QueryTimeInterval)}.

    + *

    Note: For asynchronous sample, refer to {@link com.azure.monitor.query.LogsQueryAsyncClient#queryWorkspace(java.lang.String, java.lang.String, com.azure.monitor.query.models.QueryTimeInterval) QueryWorkspace Async API}.

    * *
    * From 5a5c73ca62c6fb735b34e705c91968723d407759 Mon Sep 17 00:00:00 2001 From: Vinay Gera Date: Wed, 20 Mar 2024 15:37:56 -0700 Subject: [PATCH 4/4] fix docs --- .../java/com/azure/monitor/query/MetricsClientBuilder.java | 4 ++-- .../monitor/query/models/MetricsQueryResourcesOptions.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClientBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClientBuilder.java index 088fb7af4a56..8ea83fd3c9b7 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClientBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClientBuilder.java @@ -29,9 +29,9 @@ public final class MetricsClientBuilder implements EndpointTrait