Skip to content

Commit 4652e82

Browse files
Fix MetricDefinition mapper to return supportedAggregationTypes correctly (Azure#36708)
* Fix MetricDefinition mapper to return supportedAggregationTypes correctly * Updating the CHANGELOG.md * Updating the CHANGELOG.md --------- Co-authored-by: Jair Myree (from Dev Box) <jairmyree@microsoft.com>
1 parent d9f2071 commit 4652e82

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
### Bugs Fixed
1010

11+
- Fixed the issue with `MetricsQueryClient` and `MetricsQueryAsyncClient` where the `listMetricDefinitions` method was returning
12+
`MetricsDefinition` objects with null values for `supportedAggregationTypes`.[(#36698)](https://github.com/Azure/azure-sdk-for-java/issues/36698)
13+
1114
### Other Changes
1215

1316
## 1.2.5 (2023-09-22)

sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public static MetricDefinition mapToMetricDefinition(com.azure.monitor.query.imp
180180
? null
181181
: AggregationType.fromString(definition.getPrimaryAggregationType().toString());
182182
List<AggregationType> supportedAggregationTypes = null;
183-
if (CoreUtils.isNullOrEmpty(definition.getSupportedAggregationTypes())) {
183+
if (!CoreUtils.isNullOrEmpty(definition.getSupportedAggregationTypes())) {
184184
supportedAggregationTypes = definition.getSupportedAggregationTypes()
185185
.stream()
186186
.map(aggregationType -> AggregationType.fromString(aggregationType.toString()))

0 commit comments

Comments
 (0)