Skip to content

Commit 5ffe917

Browse files
authored
Edit pass on Monitor Query samples README (#21043)
1 parent 253dab8 commit 5ffe917

File tree

1 file changed

+36
-29
lines changed
  • sdk/monitor/azure-monitor-query/samples

1 file changed

+36
-29
lines changed

sdk/monitor/azure-monitor-query/samples/README.md

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,30 @@ products:
88
urlFragment: query-azuremonitor-samples
99
---
1010

11-
# Azure Monitor Query Client Library Python Samples
11+
# Azure Monitor Query client library Python samples
1212

1313
## Samples
14-
These code samples show common champion scenario operations with the Azure Monitor Query client library.
1514

16-
* Send a single query with LogsQueryClient and handle the response as a table: [sample_logs_single_query.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_logs_single_query.py) ([async_sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/async_samples/sample_log_query_async.py))
15+
The following code samples show common scenarios with the Azure Monitor Query client library.
1716

18-
* Send a single query with LogsQueryClient and handle the response in key value form: [sample_logs_query_key_value_form.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_logs_query_key_value_form.py)
17+
### Logs query samples
1918

20-
* Send a single query with LogsQueryClient without pandas: [sample_single_log_query_without_pandas.py.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_single_log_query_without_pandas.py)
19+
- [Send a single query with LogsQueryClient and handle the response as a table](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_logs_single_query.py) ([async sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/async_samples/sample_log_query_async.py))
20+
- [Send a single query with LogsQueryClient and handle the response in key-value form](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_logs_query_key_value_form.py)
21+
- [Send a single query with LogsQueryClient without pandas](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_single_log_query_without_pandas.py)
22+
- [Send a single query with LogsQueryClient across multiple workspaces](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_multiple_workspaces.py)
23+
- [Send multiple queries with LogsQueryClient](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_batch_query.py)
24+
- [Send a single query with LogsQueryClient using server timeout](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_server_timeout.py)
2125

22-
* Send a single query with LogsQueryClient across multiple workspaces: [sample_logs_query_multiple_workspaces.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_multiple_workspaces.py)
26+
### Metrics query samples
2327

24-
* Send multiple queries with LogsQueryClient: [sample_batch_query.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_batch_query.py)
28+
- [Send a query using MetricsQueryClient](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_metrics_query.py) ([async sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/async_samples/sample_metrics_query_async.py))
29+
- [Get a list of metric namespaces](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_metric_namespaces.py) ([async sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/async_samples/sample_metric_namespaces_async.py))
30+
- [Get a list of metric definitions](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_metric_definitions.py) ([async sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/async_samples/sample_metric_definitions_async.py))
2531

26-
* Send a single query with LogsQueryClient using server timeout: [sample_server_timeout.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_server_timeout.py)
32+
## _Disclaimer_
2733

28-
* Send a query using MetricsQueryClient: [sample_metrics_query.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_metrics_query.py) ([async_sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/async_samples/sample_metrics_query_async.py))
29-
30-
* Get a list of metric namespaces: [sample_metric_namespaces.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_metric_namespaces.py) ([async_sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/async_samples/sample_metric_namespaces_async.py))
31-
32-
* Get a list of metric definitions: [sample_metric_definitions.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_metric_definitions.py) ([async_sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/async_samples/sample_metric_definitions_async.py))
34+
_Azure SDK Python packages support for Python 2.7 is ending 01 January 2022. For more information and questions, refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_.
3335

3436
## Prerequisites
3537

@@ -40,32 +42,37 @@ These code samples show common champion scenario operations with the Azure Monit
4042

4143
## Setup
4244

43-
1. Install the latest beta version of Azure monitor query that the samples use:
45+
1. Install the latest version of the Azure Monitor Query library:
4446

45-
```bash
46-
pip install azure-monitor-query
47-
```
47+
```bash
48+
pip install azure-monitor-query
49+
```
4850

4951
2. Clone or download this sample repository.
50-
3. Open the sample folder in Visual Studio Code or your IDE of choice.
51-
4. To run most of this samples, you need azure-identity and pandas although they are optional can be replaced.
52+
3. Open the *samples* folder in Visual Studio Code or your IDE of choice.
53+
4. To run most of this samples, you need `azure-identity` and `pandas`. Although, those dependencies are optional and can be replaced.
5254

53-
```bash
54-
pip install azure-identity pandas
55-
```
55+
```bash
56+
pip install azure-identity pandas
57+
```
5658

57-
5. Finally, to run the async samples, you would need an async http framework like aiohttp
59+
5. To run the async samples, you need an asynchronous HTTP framework like `aiohttp`:
5860

59-
```bash
60-
pip install aiohttp
61-
```
61+
```bash
62+
pip install aiohttp
63+
```
6264

63-
## Running the samples
65+
## Run the samples
6466

6567
1. Open a terminal window and `cd` to the directory that the samples are saved in.
6668
2. Set the environment variables specified in the sample file you wish to run.
67-
3. Follow the usage described in the file, e.g. `python sample_logs_single_query.py`
69+
3. Follow the usage described in the file. For example, `python sample_logs_single_query.py`.
6870

6971
## Next steps
7072

71-
To learn more about Azure Monitor, see the [Azure Monitor service documentation](https://docs.microsoft.com/azure/azure-monitor/).
73+
To learn more about Azure Monitor, see the [Azure Monitor service documentation](https://docs.microsoft.com/azure/azure-monitor/).
74+
75+
<!-- LINKS -->
76+
77+
[azure_monitor_create_using_portal]: https://docs.microsoft.com/azure/azure-monitor/logs/quick-create-workspace
78+
[azure_subscription]: https://azure.microsoft.com/free/python/

0 commit comments

Comments
 (0)