diff --git a/sdk/monitor/azure-monitor-query/README.md b/sdk/monitor/azure-monitor-query/README.md index a6e04bc7b829..fca50b7ee54e 100644 --- a/sdk/monitor/azure-monitor-query/README.md +++ b/sdk/monitor/azure-monitor-query/README.md @@ -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( - , - query, - additional_workspaces=['', ''] - ) -``` - #### 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). @@ -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( + , + query, + additional_workspaces=['', ''] + ) +``` + +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. diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py index 2eb2c828061b..a0d12433709a 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py @@ -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 ( diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_log_query_client.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py similarity index 100% rename from sdk/monitor/azure-monitor-query/azure/monitor/query/_log_query_client.py rename to sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/__init__.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/__init__.py index 316114b34044..9dbf3b056c78 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/__init__.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/__init__.py @@ -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__ = [ diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_log_query_client_async.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py similarity index 100% rename from sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_log_query_client_async.py rename to sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py