Skip to content

Commit

Permalink
Small tweaks to Monitor Query SDK README (#20905)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaddie committed Sep 28, 2021
1 parent f88dc92 commit 131546b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sdk/monitor/azure-monitor-query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ except HttpResponseError as err:

#### Handle logs query response

The `query` API returns a union of `LogsQueryResult` and `LogsQueryPartialResult` while the `batch_query` API returns list of `LogsQueryResult`, `LogsQueryPartialResult` and `LogsQueryError` objects. Here's a hierarchy of the response:
The `query_workspace` API returns a union of `LogsQueryResult` and `LogsQueryPartialResult` objects, while the `batch_query` API returns list of `LogsQueryResult`, `LogsQueryPartialResult`, and `LogsQueryError` objects. Here's a hierarchy of the response:

```
LogsQueryResult
Expand All @@ -164,8 +164,7 @@ LogsQueryPartialResult
|---column_types
```

The `LogsQueryResult` directly iterates over the table as a convinience.
For example, to handle a logs query response with tables and display it using pandas:
The `LogsQueryResult` directly iterates over the table as a convenience. For example, to handle a logs query response with tables and display it using pandas:

```python
response = client.query(...)
Expand All @@ -189,7 +188,7 @@ A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/

### Batch logs query

The following example demonstrates sending multiple queries at the same time using batch query API. The queries can either be represented as a list of `LogsBatchQuery` objects or a dictionary. This example uses the former approach.
The following example demonstrates sending multiple queries at the same time using the batch query API. The queries can either be represented as a list of `LogsBatchQuery` objects or a dictionary. This example uses the former approach.

```python
import os
Expand Down Expand Up @@ -287,7 +286,7 @@ A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/

### Metrics query

The following example gets metrics for an Event Grid subscription. The resource URI is that of an event grid topic.
The following example gets metrics for an Event Grid subscription. The resource URI is that of an Event Grid topic.

The resource URI must be that of the resource for which metrics are being queried. It's normally of the format `/subscriptions/<id>/resourceGroups/<rg-name>/providers/<source>/topics/<resource-name>`.

Expand Down Expand Up @@ -325,7 +324,7 @@ for metric in response.metrics:

#### Handle metrics query response

The metrics query API returns a `MetricsResult` object. The `MetricsResult` object contains properties such as a list of `Metric`-typed objects, `granularity`, `namespace`, and `timespan`. The `Metric` objects list can be accessed using the `metrics` param. Each `Metric` object in this list contains a list of `TimeSeriesElement` objects. Each `TimeSeriesElement` contains `data` and `metadata_values` properties. In visual form, the object hierarchy of the response resembles the following structure:
The metrics query API returns a `MetricsResult` object. The `MetricsResult` object contains properties such as a list of `Metric`-typed objects, `granularity`, `namespace`, and `timespan`. The `Metric` objects list can be accessed using the `metrics` param. Each `Metric` object in this list contains a list of `TimeSeriesElement` objects. Each `TimeSeriesElement` object contains `data` and `metadata_values` properties. In visual form, the object hierarchy of the response resembles the following structure:

```
MetricsResult
Expand Down

0 comments on commit 131546b

Please sign in to comment.