diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/LocalizableString.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/LocalizableString.java index ca9edee10418e..1ee9aa5e7d077 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/LocalizableString.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/LocalizableString.java @@ -4,12 +4,14 @@ package com.azure.monitor.query.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; /** The localizable string class. */ @Fluent public final class LocalizableString { + private final ClientLogger logger = new ClientLogger(LocalizableString.class); /* * the invariant value. */ @@ -68,7 +70,8 @@ public LocalizableString setLocalizedValue(String localizedValue) { */ public void validate() { if (getValue() == null) { - throw new IllegalArgumentException("Missing required property value in model LocalizableString"); + throw logger.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model LocalizableString")); } } } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsAvailability.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsAvailability.java index af3a47d93bcf4..79fc9d24ee7d1 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsAvailability.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsAvailability.java @@ -76,5 +76,5 @@ public MetricsAvailability setRetention(Duration retention) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - public void validate() {} + public void validate() { } } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsNamespaceName.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsNamespaceName.java index 1e8df739eb245..b0448b1349210 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsNamespaceName.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsNamespaceName.java @@ -40,5 +40,5 @@ public MetricsNamespaceName setMetricNamespaceName(String metricNamespaceName) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - public void validate() {} + public void validate() { } } diff --git a/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/ServerTimeoutSample.java b/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/ServerTimeoutSample.java index 6ae21c1d40481..10293731efc95 100644 --- a/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/ServerTimeoutSample.java +++ b/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/ServerTimeoutSample.java @@ -3,8 +3,6 @@ package com.azure.monitor.query; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.Configuration; import com.azure.core.util.Context; diff --git a/sdk/monitor/azure-monitor-query/src/test/resources/session-records/MetricsClientTest.testMetricsQuery.json b/sdk/monitor/azure-monitor-query/src/test/resources/session-records/MetricsClientTest.testMetricsQuery.json index 8cc866fffae66..ad0d2fa2096dc 100644 --- a/sdk/monitor/azure-monitor-query/src/test/resources/session-records/MetricsClientTest.testMetricsQuery.json +++ b/sdk/monitor/azure-monitor-query/src/test/resources/session-records/MetricsClientTest.testMetricsQuery.json @@ -1,7 +1,7 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.azure.com//subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/srnagar-azuresdkgroup/providers/Microsoft.CognitiveServices/accounts/srnagara-textanalytics/providers/microsoft.insights/metrics?timespan=PT720H&interval=PT1H&metricnames=SuccessfulCalls&aggregation=1%2C2%2C3%2C4%2C5&top=100&resultType=Data&api-version=2018-01-01&metricnamespace=Microsoft.CognitiveServices/accounts", + "Uri" : "https://REDACTED.azure.com//subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/srnagar-azuresdkgroup/providers/Microsoft.CognitiveServices/accounts/srnagara-textanalytics/providers/microsoft.insights/metrics?timespan=PT720H&interval=PT1H&metric=SuccessfulCalls&aggregation=1%2C2%2C3%2C4%2C5&top=100&resultType=Data&api-version=2017-05-01-preview&metricnamespace=Microsoft.CognitiveServices/accounts", "Headers" : { "User-Agent" : "azsdk-java-UnknownName/UnknownVersion (14.0.2; Windows 10; 10.0)" }, @@ -29,4 +29,4 @@ "Exception" : null } ], "variables" : [ ] -} \ No newline at end of file +} diff --git a/sdk/monitor/ci.yml b/sdk/monitor/ci.yml index f0a481f70d8e3..cb7cdb898c366 100644 --- a/sdk/monitor/ci.yml +++ b/sdk/monitor/ci.yml @@ -53,3 +53,6 @@ extends: - name: azure-monitor-opentelemetry-exporter groupId: com.azure safeName: azuremonitoropentelemetryexporter + - name: azure-monitor-query + groupId: com.azure + safeName: azuremonitorquery