Skip to content

Conversation

@g2vinay
Copy link
Member

@g2vinay g2vinay commented Jan 24, 2024

Revamps Javadocs for Azure Monitor Query.

@g2vinay g2vinay requested a review from jairmyree January 24, 2024 19:10
@github-actions github-actions bot added the Monitor Monitor, Monitor Ingestion, Monitor Query label Jan 24, 2024
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@g2vinay g2vinay marked this pull request as ready for review March 20, 2024 22:46
@g2vinay g2vinay requested review from a team, lmolkova and srnagar as code owners March 20, 2024 22:46
@g2vinay g2vinay changed the title Add Javadocs for Monitor Query [WIP] Add Javadocs for Monitor Query Mar 20, 2024
Copy link
Member

@jairmyree jairmyree left a comment

Choose a reason for hiding this comment

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

Thank you @g2vinay

@jairmyree jairmyree merged commit cb91683 into main Mar 21, 2024
@jairmyree jairmyree deleted the add-monitor-query-javadoc branch March 21, 2024 17:43
* <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

* <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

* <!-- 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}

Comment on lines +40 to +41
* of a system at a particular time. The MetricsQueryClient provides synchronous implementations of methods that query
* metrics from your Azure services.</p>
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.

*
* <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

*/
public MetricsQueryResourcesOptions() { }

private String rollupBy;
Copy link
Member

Choose a reason for hiding this comment

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

The constructor should be below this property.

/**
* Package containing clients for querying logs and metrics from Azure Monitor.
* <p>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
Copy link
Member

Choose a reason for hiding this comment

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

Only logs query uses Kusto Query Language. Metrics queries don't. So, we should update this doc to differentiate.

* 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.</p>
*
* <p>Azure Monitor Query java client library is a library that allows you to execute read-only 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.

Azure Monitor Query java client library allows you to execute

*
* <h2>Getting Started</h2>
*
* <p>In order to interact with the Monitor service you'll need to create an instance of the
Copy link
Member

Choose a reason for hiding this comment

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

interact with the Azure Monitor service

Comment on lines +93 to +106
* <p>The sample below shows how to query logs from the last 24 hours</p>
*
* <!-- src_embed com.azure.monitor.query.LogsQueryClient.query#String-String-QueryTimeInterval -->
* <pre>
* LogsQueryResult queryResult = logsQueryClient.queryWorkspace&#40;&quot;&#123;workspace-id&#125;&quot;, &quot;&#123;kusto-query&#125;&quot;,
* QueryTimeInterval.LAST_DAY&#41;;
* for &#40;LogsTableRow row : queryResult.getTable&#40;&#41;.getRows&#40;&#41;&#41; &#123;
* System.out.println&#40;row.getRow&#40;&#41;
* .stream&#40;&#41;
* .map&#40;LogsTableCell::getValueAsString&#41;
* .collect&#40;Collectors.joining&#40;&quot;,&quot;&#41;&#41;&#41;;
* &#125;
* </pre>
* <!-- end com.azure.monitor.query.LogsQueryClient.query#String-String-QueryTimeInterval -->
Copy link
Member

Choose a reason for hiding this comment

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

We should have a sample for querying metrics too if we are going to add a sample for querying logs here.

@g2vinay g2vinay restored the add-monitor-query-javadoc branch March 21, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor Monitor, Monitor Ingestion, Monitor Query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants