Skip to content

Commit

Permalink
Document role requirement for multi-resource metrics queries (#29241)
Browse files Browse the repository at this point in the history
React to feedback in
Azure/azure-sdk-blog#479 (comment).
Also apply small changes as part of a cross-language README consistency
review.
  • Loading branch information
scottaddie committed Apr 10, 2024
1 parent f8225dd commit 156d92c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sdk/monitor/monitor-query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For more information, see our [support policy](https://github.com/Azure/azure-sd
Install the Azure Monitor Query client library for JavaScript with npm:

```bash
npm install @azure/monitor-query
npm install --save @azure/monitor-query
```

### Create the client
Expand Down Expand Up @@ -113,6 +113,8 @@ Each set of metric values is a time series with the following characteristics:
- [Advanced logs query scenarios](#advanced-logs-query-scenarios)
- [Set logs query timeout](#set-logs-query-timeout)
- [Query multiple workspaces](#query-multiple-workspaces)
- [Include statistics](#include-statistics)
- [Include visualization](#include-visualization)
- [Metrics query](#metrics-query)
- [Handle metrics query response](#handle-metrics-query-response)
- [Example of handling response](#example-of-handling-response)
Expand All @@ -122,7 +124,7 @@ Each set of metric values is a time series with the following characteristics:

The `LogsQueryClient` can be used to query a Log Analytics workspace using the [Kusto Query Language][kusto_query_language]. The `timespan.duration` can be specified as a string in an ISO 8601 duration format. You can use the `Durations` constants provided for some commonly used ISO 8601 durations.

You can query logs by workspace ID or resource ID. The result is returned as a table with a collection of rows.
You can query logs by Log Analytics workspace ID or Azure resource ID. The result is returned as a table with a collection of rows.

#### Workspace-centric logs query

Expand Down Expand Up @@ -841,7 +843,10 @@ Each Azure resource must reside in:
- The same region as the endpoint specified when creating the client.
- The same Azure subscription.

Furthermore, the metric namespace containing the metrics to be queried must be provided. For a list of metric namespaces, see [Supported metrics and log categories by resource type][metric_namespaces].
Furthermore:

- The user must be authorized to read monitoring data at the Azure subscription level. For example, the [Monitoring Reader role](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles/monitor#monitoring-reader) on the subscription to be queried.
- The metric namespace containing the metrics to be queried must be provided. For a list of metric namespaces, see [Supported metrics and log categories by resource type][metric_namespaces].

```ts
let resourceIds: string[] = [
Expand Down

0 comments on commit 156d92c

Please sign in to comment.