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
28 changes: 16 additions & 12 deletions sdk/monitor/azure-monitor-query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,6 @@ for table in response.tables:
print(df)
```

#### Query multiple workspaces

The `additional_workspaces` parameter can be used to pass a list of workspaces that are included in the query when querying a single query over multiple workspaces. The parameter's list items can be qualified workspace names, workspace IDs, or Azure resource IDs. A primary workspace ID must be provided when querying multiple workspaces, as in the following example:

```python
client.query(
<primary_workspace_id>,
query,
additional_workspaces=['<workspace 1>', '<workspace 2>']
)
```

#### Set logs query timeout

The following example shows setting a server timeout in seconds. A gateway timeout is raised if the query takes more time than the mentioned timeout. The default is 180 seconds and can be set up to 10 minutes (600 seconds).
Expand Down Expand Up @@ -313,6 +301,22 @@ for metric in response.metrics:
)
```

### Advacned Scenarios

#### Query multiple workspaces

One of the more advanced scenarios is to query the same query on multiple workspaces. The `additional_workspaces` parameter can be used to pass a list of workspaces that are included in the query when querying a single query over multiple workspaces. The parameter's list items can be qualified workspace names, workspace IDs, or Azure resource IDs. A primary workspace ID must be provided when querying multiple workspaces, as in the following example:

```python
client.query(
<primary_workspace_id>,
query,
additional_workspaces=['<workspace 1>', '<workspace 2>']
)
```

The full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_multiple_workspaces.py).

## Troubleshooting

Enable the `azure.monitor.query` logger to collect traces from the library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------

from ._log_query_client import LogsQueryClient
from ._logs_query_client import LogsQueryClient
from ._metrics_query_client import MetricsQueryClient

from ._models import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------

from ._log_query_client_async import LogsQueryClient
from ._logs_query_client_async import LogsQueryClient
from ._metrics_query_client_async import MetricsQueryClient

__all__ = [
Expand Down