Skip to content

Commit 4300407

Browse files
committed
[Monitor Query] Prepare 1.2.1 release
Signed-off-by: Paul Van Eck <[email protected]>
1 parent c5c0916 commit 4300407

35 files changed

+72
-4531
lines changed

sdk/monitor/azure-monitor-query/CHANGELOG.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
# Release History
22

3-
## 1.3.0 (Unreleased)
4-
5-
### Features Added
6-
7-
- Added `roll_up_by` keyword argument to `MetricsBatchQueryClient.query_batch` to support rolling up metrics by dimension. ([#33752](https://github.com/Azure/azure-sdk-for-python/pull/33752))
8-
9-
### Breaking Changes
10-
11-
- The following changes are breaking against the previous preview release (i.e. `1.3.0b2`/`1.3.0b1`):
12-
- Reordered the arguments for the async `MetricsBatchQueryClient` constructor so that `endpoint` is now the first positional argument. ([#33752](https://github.com/Azure/azure-sdk-for-python/pull/33752))
13-
- Reordered the `metric_names` and `metric_namespace` positional arguments in `MetricsBatchQueryClient.query_batch`. ([#33752](https://github.com/Azure/azure-sdk-for-python/pull/33752))
3+
## 1.2.1 (2024-01-31)
144

155
### Bugs Fixed
166

7+
- Fixed certain keyword arguments from being propagated when using `MetricsQueryClient`.
8+
179
### Other Changes
1810

11+
- Internal updates to generated code.
12+
- Bumped minimum dependency on `azure-core` to `>=1.28.0`.
13+
1914
## 1.3.0b2 (2023-11-20)
2015

2116
### Other Changes

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

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pip install azure-monitor-query
3737

3838
### Create the client
3939

40-
An authenticated client is required to query Logs or Metrics. The library includes both synchronous and asynchronous forms of the clients. To authenticate, create an instance of a token credential. Use that instance when creating a `LogsQueryClient`, `MetricsQueryClient`, or `MetricsBatchQueryClient`. The following examples use `DefaultAzureCredential` from the [azure-identity](https://pypi.org/project/azure-identity/) package.
40+
An authenticated client is required to query Logs or Metrics. The library includes both synchronous and asynchronous forms of the clients. To authenticate, create an instance of a token credential. Use that instance when creating a `LogsQueryClient` or `MetricsQueryClient`. The following examples use `DefaultAzureCredential` from the [azure-identity](https://pypi.org/project/azure-identity/) package.
4141

4242
#### Synchronous clients
4343

@@ -525,43 +525,6 @@ for metric in response.metrics:
525525
)
526526
```
527527

528-
### Metrics batch query
529-
530-
A user can also query metrics from multiple resources at once using the `query_batch` method of `MetricsBatchQueryClient`. This uses a different API than the `MetricsQueryClient` and requires that a user pass in a regional endpoint when instantiating the client (for example, "https://westus3.metrics.monitor.azure.com").
531-
532-
Note, each resource must be in the same region as the endpoint passed in when instantiating the client, and each resource must be in the same Azure subscription. Furthermore, the metric namespace that contains the metrics to be queried must also be passed. A list of metric namespaces can be found [here][metric_namespaces].
533-
534-
535-
```python
536-
from datetime import timedelta
537-
import os
538-
539-
from azure.core.exceptions import HttpResponseError
540-
from azure.identity import DefaultAzureCredential
541-
from azure.monitor.query import MetricsBatchQueryClient, MetricAggregationType
542-
543-
544-
credential = DefaultAzureCredential()
545-
client = MetricsBatchQueryClient(endpoint, credential)
546-
547-
resource_uris = [
548-
"/subscriptions/<id>/resourceGroups/<rg-name>/providers/<source>/storageAccounts/<resource-name-1>",
549-
"/subscriptions/<id>/resourceGroups/<rg-name>/providers/<source>/storageAccounts/<resource-name-2>"
550-
]
551-
552-
response = client.query_batch(
553-
resource_uris,
554-
metric_namespace="Microsoft.Storage/storageAccounts",
555-
metric_names=["Ingress"],
556-
timespan=timedelta(hours=2),
557-
granularity=timedelta(minutes=5),
558-
aggregations=[MetricAggregationType.AVERAGE],
559-
)
560-
561-
for metrics_query_result in response:
562-
print(metrics_query_result.timespan)
563-
```
564-
565528
## Troubleshooting
566529

567530
See our [troubleshooting guide][troubleshooting_guide] for details on how to diagnose various failure scenarios.
@@ -606,7 +569,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
606569
[azure_subscription]: https://azure.microsoft.com/free/python/
607570
[changelog]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-query/CHANGELOG.md
608571
[kusto_query_language]: https://learn.microsoft.com/azure/data-explorer/kusto/query/
609-
[metric_namespaces]: https://learn.microsoft.com/azure/azure-monitor/reference/supported-metrics/metrics-index#metrics-by-resource-provider
610572
[package]: https://aka.ms/azsdk-python-monitor-query-pypi
611573
[pip]: https://pypi.org/project/pip/
612574
[python_logging]: https://docs.python.org/3/library/logging.html

sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from ._logs_query_client import LogsQueryClient
88
from ._metrics_query_client import MetricsQueryClient
9-
from ._metrics_batch_query_client import MetricsBatchQueryClient
109

1110
from ._enums import (
1211
LogsQueryStatus,
@@ -46,7 +45,6 @@
4645
"LogsTableRow",
4746
"LogsBatchQuery",
4847
"MetricsQueryClient",
49-
"MetricsBatchQueryClient",
5048
"MetricNamespace",
5149
"MetricNamespaceClassification",
5250
"MetricDefinition",

sdk/monitor/azure-monitor-query/azure/monitor/query/_generated/metrics/batch/__init__.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

sdk/monitor/azure-monitor-query/azure/monitor/query/_generated/metrics/batch/_client.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

sdk/monitor/azure-monitor-query/azure/monitor/query/_generated/metrics/batch/_configuration.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

sdk/monitor/azure-monitor-query/azure/monitor/query/_generated/metrics/batch/_patch.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)