Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@
import static com.azure.monitor.query.implementation.logs.models.LogsQueryHelper.mapLogsQueryError;

/**
* The asynchronous client for querying Azure Monitor logs.
* <p><strong>Instantiating an asynchronous Logs query Client</strong></p>
* <p>Provides an asynchronous service client for querying logs in the Azure Monitor Service.</p>
*
* <p>The LogsQueryClient is an asynchronous client that provides methods to execute Kusto queries against
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LogsQueryAsyncClient

* 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.</p>
*
* <h2>Getting Started</h2>
*
* <p>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.</p>
*
* <!-- src_embed com.azure.monitor.query.LogsQueryAsyncClient.instantiation -->
* <pre>
Expand All @@ -47,6 +55,38 @@
* .buildAsyncClient&#40;&#41;;
* </pre>
* <!-- end com.azure.monitor.query.LogsQueryAsyncClient.instantiation -->
*
* <p>For more information on building and authenticating, see the {@link LogsQueryClientBuilder} documentation.</p>
*
* <h3>Client Usage</h3>
*
* <p>
* For more information on how to use this client, see the following method documentation:
* </p>
*
* <ul>
* <li>
* {@link LogsQueryAsyncClient#queryWorkspace(String, String, QueryTimeInterval) queryWorkspace(String, String, QueryTimeInterval)} - Query logs from a workspace.
* </li>
* <li>
* {@link LogsQueryAsyncClient#queryWorkspaceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions) queryWorkspaceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions)} - Query logs from a workspace using query options with service response returned.
* </li>
* <li>
* {@link LogsQueryAsyncClient#queryBatch(LogsBatchQuery) queryBatch(LogsBatchQuery)} - Execute a batch of logs queries.
* </li>
* <li>
* {@link LogsQueryAsyncClient#queryBatchWithResponse(LogsBatchQuery) queryBatchWithResponse(LogsBatchQuery)} - Execute a batch of logs queries with service response returned.
* </li>
* <li>
* {@link LogsQueryAsyncClient#queryResource(String, String, QueryTimeInterval) queryResource(String, String, QueryTimeInterval)} - Query logs for an Azure resource.
* </li>
* <li>
* {@link LogsQueryAsyncClient#queryResourceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions) queryResourceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions)} - Query logs for an Azure resource using query options with service response returned.
* </li>
* </ul>
*
* @see com.azure.monitor.query
* @see LogsQueryClientBuilder
*/
@ServiceClient(builder = LogsQueryClientBuilder.class, isAsync = true)
public final class LogsQueryAsyncClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@
import static com.azure.monitor.query.implementation.logs.models.LogsQueryHelper.updateContext;

/**
* The synchronous client for querying Azure Monitor logs.
* <p>Provides a synchronous service client for querying logs in the Azure Monitor Service.</p>
*
* <p><strong>Instantiating a synchronous Logs query Client</strong></p>
* <p>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.</p>
*
* <h2>Getting Started</h2>
*
* <p>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.</p>
*
* <!-- src_embed com.azure.monitor.query.LogsQueryClient.instantiation -->
* <pre>
Expand All @@ -46,6 +53,38 @@
* .buildClient&#40;&#41;;
* </pre>
* <!-- end com.azure.monitor.query.LogsQueryClient.instantiation -->
*
* <p>For more information on building and authenticating, see the {@link LogsQueryClientBuilder} documentation.</p>
*
* <h3>Client Usage</h3>
*
* <p>
* For more information on how to use this client, see the following method documentation:
* </p>
*
* <ul>
* <li>
* {@link LogsQueryClient#queryWorkspace(String, String, QueryTimeInterval) queryWorkspace(String, String, QueryTimeInterval)} - Query logs from a workspace.
* </li>
* <li>
* {@link LogsQueryClient#queryWorkspaceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions, Context) queryWorkspaceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions, Context)} - Query logs from a workspace using query options and context with service response returned.
* </li>
* <li>
* {@link LogsQueryClient#queryBatch(LogsBatchQuery) queryBatch(LogsBatchQuery)} - Execute a batch of logs queries.
* </li>
* <li>
* {@link LogsQueryClient#queryBatchWithResponse(LogsBatchQuery, Context) queryBatchWithResponse(LogsBatchQuery, Context)} - Execute a batch of logs queries with context and service response returned.
* </li>
* <li>
* {@link LogsQueryClient#queryResource(String, String, QueryTimeInterval) queryResource(String, String, QueryTimeInterval)} - Query logs for an Azure resource.
* </li>
* <li>
* {@link LogsQueryClient#queryResourceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions, Context) queryResourceWithResponse(String, String, QueryTimeInterval, LogsQueryOptions, Context)} - Query logs for an Azure resource with query options and context with service response returned.
* </li>
* </ul>
*
* @see com.azure.monitor.query
* @see LogsQueryClientBuilder
*/
@ServiceClient(builder = LogsQueryClientBuilder.class)
public final class LogsQueryClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,23 @@
import com.azure.monitor.query.implementation.logs.AzureLogAnalyticsImplBuilder;

/**
* Fluent builder for creating instances of {@link LogsQueryClient} and {@link LogsQueryAsyncClient}.
* <p>Fluent builder for creating instances of {@link LogsQueryClient} and {@link LogsQueryAsyncClient}.</p>
*
* <p><strong>Instantiating an asynchronous Logs query Client</strong></p>
* <p>The LogsQueryClientBuilder is responsible for authenticating a building instances of {@link LogsQueryClient} and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for authenticating should be removed

* {@link LogsQueryAsyncClient}. Customizations can be applied to clients through the builder using the various options
* available.</p>
*
* <h2>Getting Started</h2>
*
* <p>
* 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.
* </p>
*
* <h3>Client Builder Usage</h3>
*
* <p>The following sample shows instantiating an asynchronous Logs query Client using Token Credential</p>
*
* <!-- src_embed com.azure.monitor.query.LogsQueryAsyncClient.instantiation -->
* <pre>
Expand All @@ -33,7 +47,7 @@
* </pre>
* <!-- end com.azure.monitor.query.LogsQueryAsyncClient.instantiation -->
*
* <p><strong>Instantiating a synchronous Logs query Client</strong></p>
* <p>The following sample shows instantiating a synchronous Logs query Client using Token Credential</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client -> client and using Token Credential should be updated to using {@link TokenCredential}

*
* <!-- src_embed com.azure.monitor.query.LogsQueryClient.instantiation -->
* <pre>
Expand All @@ -42,6 +56,15 @@
* .buildClient&#40;&#41;;
* </pre>
* <!-- end com.azure.monitor.query.LogsQueryClient.instantiation -->
*
* <p>
* For more information about the other types of credentials that can be used to authenticate your client, please see
* this documentation: <a href="https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable">Azure Identity</a>
* </p>
*
* @see com.azure.monitor.query
* @see LogsQueryClient
* @see LogsQueryAsyncClient
*/
@ServiceClientBuilder(serviceClients = {LogsQueryClient.class, LogsQueryAsyncClient.class})
public final class LogsQueryClientBuilder implements EndpointTrait<LogsQueryClientBuilder>,
Expand All @@ -50,6 +73,11 @@ public final class LogsQueryClientBuilder implements EndpointTrait<LogsQueryClie
private final AzureLogAnalyticsImplBuilder innerLogBuilder = new AzureLogAnalyticsImplBuilder();
private LogsQueryServiceVersion serviceVersion;

/**
* Creates an instance of LogsQueryClientBuilder.
*/
public LogsQueryClientBuilder() { }

/**
* Sets the log query endpoint.
* @param endpoint the host value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public final class MetricsClientBuilder implements EndpointTrait<MetricsClientBu

private final AzureMonitorMetricBatchBuilder innerMetricsBatchBuilder = new AzureMonitorMetricBatchBuilder();

/**
* Creates an instance of MetricsClientBuilder.
*/
public MetricsClientBuilder() { }

/**
* Sets the metrics batch query endpoint.
* @param endpoint the endpoint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,19 @@
import static com.azure.monitor.query.implementation.metrics.models.MetricsHelper.convertToMetricsQueryResult;

/**
* The asynchronous client for querying Azure Monitor metrics.
* <p><strong>Instantiating an asynchronous Metrics query Client</strong></p>
* <p>The asynchronous client for querying Azure Monitor metrics.</p>
*
* <p>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.</p>
Comment on lines +40 to +41
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be about the async client.

*
* <h2>Getting Started</h2>
*
* <p>
* Authenticating and building MetricsQueryAsyncClient instances are done through {@link MetricsQueryClientBuilder}.
* The following sample shows how to build a new MetricsQueryClient instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MetricsQueryClient -> MetricsQueryAsyncClient

* </p>
*
* <!-- src_embed com.azure.monitor.query.MetricsQueryAsyncClient.instantiation -->
* <pre>
Expand All @@ -43,6 +54,27 @@
* .buildAsyncClient&#40;&#41;;
* </pre>
* <!-- end com.azure.monitor.query.MetricsQueryAsyncClient.instantiation -->
*
* <p>
* For more information on building and authenticating, see the {@link MetricsQueryClientBuilder} documentation.
* </p>
*
* <h3>Client Usage</h3>
*
* <p>
* For more information on using the MetricsQueryAsyncClient, see the following method documentation:
* </p>
*
* <ul>
* <li>
* {@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.
* </li>
* </ul>
*
* @see com.azure.monitor.query
* @see MetricsQueryClientBuilder
*/
@ServiceClient(builder = MetricsQueryClientBuilder.class, isAsync = true)
public final class MetricsQueryAsyncClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,48 @@
import static com.azure.monitor.query.implementation.metrics.models.MetricsHelper.convertToMetricsQueryResult;

/**
* The synchronous client for querying Azure Monitor metrics.
* <p>The synchronous client for querying Azure Monitor metrics.</p>
*
* <p>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.</p>
*
* <h2>Getting Started</h2>
*
* <p>
* Authenticating and building MetricsQueryClient instances are done through {@link MetricsQueryClientBuilder}.
* The following sample shows how to build a new MetricsQueryClient instance.
* </p>
*
* <p><strong>Instantiating a synchronous Metrics query Client</strong></p>
* <!-- src_embed com.azure.monitor.query.MetricsQueryClient.instantiation -->
* <pre>
* MetricsQueryClient metricsQueryClient = new MetricsQueryClientBuilder&#40;&#41;
* .credential&#40;tokenCredential&#41;
* .buildClient&#40;&#41;;
* </pre>
* <!-- end com.azure.monitor.query.MetricsQueryClient.instantiation -->
*
* <p>
* For more information on building and authenticating, see the {@link MetricsQueryClientBuilder} documentation.
* </p>
*
* <h3>Client Usage</h3>
*
* <p>
* For more information on using the MetricsQueryClient, see the following method documentation:
* </p>
*
* <ul>
* <li>
* {@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.
* </li>
* </ul>
*
* @see com.azure.monitor.query
* @see MetricsQueryClientBuilder
*/
@ServiceClient(builder = MetricsQueryClientBuilder.class)
public final class MetricsQueryClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,27 @@
import com.azure.monitor.query.implementation.metricsnamespaces.MetricsNamespacesClientImplBuilder;

/**
* Fluent builder for creating instances of {@link MetricsQueryClient} and {@link MetricsQueryAsyncClient}.
* <p>Fluent builder for creating instances of {@link MetricsQueryClient} and {@link MetricsQueryAsyncClient}.</p>
*
* <p><strong>Instantiating an asynchronous Metrics query Client</strong></p>
* <p>
* 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.
* </p>
*
* <h2>Getting Started</h2>
*
* <p>
* 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.
* </p>
*
* <h3>Client Builder Usage</h3>
*
* <p>
* The following sample shows instantiating an asynchronous Metrics query Client using Token Credential
* </p>
*
* <!-- src_embed com.azure.monitor.query.MetricsQueryAsyncClient.instantiation -->
* <pre>
Expand All @@ -36,7 +54,9 @@
* </pre>
* <!-- end com.azure.monitor.query.MetricsQueryAsyncClient.instantiation -->
*
* <p><strong>Instantiating a synchronous Metrics query Client</strong></p>
* <p>
* The following sample shows instantiating a synchronous Metrics query Client using Token Credential
* </p>
*
* <!-- src_embed com.azure.monitor.query.MetricsQueryClient.instantiation -->
* <pre>
Expand All @@ -45,6 +65,15 @@
* .buildClient&#40;&#41;;
* </pre>
* <!-- end com.azure.monitor.query.MetricsQueryClient.instantiation -->
*
* <p>
* For more information about the other types of credentials that can be used to authenticate your client, please see
* this documentation: <a href="https://learn.microsoft.com/java/api/overview/azure/identity-readme?view=azure-java-stable">Azure Identity</a>
* </p>
*
* @see com.azure.monitor.query
* @see MetricsQueryClient
* @see MetricsQueryAsyncClient
*/
@ServiceClientBuilder(serviceClients = {MetricsQueryClient.class, MetricsQueryAsyncClient.class})
public final class MetricsQueryClientBuilder implements EndpointTrait<MetricsQueryClientBuilder>,
Expand All @@ -60,6 +89,11 @@ public final class MetricsQueryClientBuilder implements EndpointTrait<MetricsQue
private final ClientLogger logger = new ClientLogger(MetricsQueryClientBuilder.class);
private MetricsQueryServiceVersion serviceVersion;

/**
* Creates an instance of MetricsQueryClientBuilder.
*/
public MetricsQueryClientBuilder() { }

/**
* Sets the metrics query endpoint.
* @param endpoint the host value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public Duration getMaxServerTimeout(LogsBatchQuery query) {
});
}

/**
* Creates an instance of LogsBatchQuery.
*/
public LogsBatchQuery() { }

/**
* Adds a new logs query to the batch.
* @param workspaceId The workspaceId on which the query is executed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public final class LogsColumnType extends ExpandableStringEnum<LogsColumnType> {
/** 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.
*
Expand All @@ -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<LogsColumnType> values() {
return values(LogsColumnType.class);
}
Expand Down
Loading