-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Describe the suggested improvement
Is your improvement related to a problem? Please describe.
On ~2025-10-17, Microsoft deprecated the Azure.Monitor.Query and replaced it with new packages; Azure.Monitor.Query.Logs and Azure.Monitor.Query.Metrics. They specified that the Azure Monitor Query library for .NET has been modularized to provide more focused functionality.
This package is used with ServiceControl. Within the ServiceControl.Transports.ASBS project, the AzureQuery class leverages the Azure.Monitor.Query.MetricsQueryClient client to gather throughput metrics for ASB.
Describe the suggested solution
The How to migrate away from Azure.Monitor.Query document details the recommended approach from Microsoft. The document recommends migrating to the package Azure.ResourceManager.Monitor, however the migration guidance is wrong, in that it directs you to the Guide for migrating from Azure.Monitor.Query to Azure.Monitor.Query.Metrics document.
Upon review, we found that the MetricsQueryClient no longer exists within the code base. However, the MetricsClient and MetricsQueryClient provided largely the same functionality. The only difference being that the MetricsClient allowed querying metrics for multiple resources, whereas the MetricsQueryClient supported querying a single resource.
Based on this, the recommended solution is to migrate from Azure.Query.Monitor.MetricsQueryClient (deprecated) to the new Azure.Query.Monitor.Metrics.MetricsClient and the recommended solution has been implemented within; #5147.
Describe alternatives you've considered
In the deprecated packages, we found that both clients leverage the MetricsRestClient in Azure.ResourceManager.Monitor. So the alternative option was to migrate to that client, however we preferred to avoid the low-level nature of the MetricsRestClient, especially considering that the API surface of the new MetricsClient largely matched that of the deprecated MetricsQueryClient.
Additional Context
No response