-
Notifications
You must be signed in to change notification settings - Fork 48
Migrate from Azure.Monitor.Query (deprecated) to Azure.Monitor.Query.Metrics #5147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@jasontaylordev I just want to confirm that the guidance in https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/MigrationGuide_Query.md is incorrect? |
johnsimons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes LGTM, but I am unsure about the move of the client initialisation to the GetQueueNames method?
| client = new MetricsClient( | ||
| metricsEndpoint, | ||
| credential!, | ||
| new MetricsClientOptions | ||
| { | ||
| Audience = metricsQueryAudience, | ||
| Transport = new HttpClientTransport( | ||
| new HttpClient(new SocketsHttpHandler | ||
| { | ||
| PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) | ||
| })) | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the motivation to move the initialisation of the client to this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metricsEndpoint needs to specify the region which can only be done once we have the ASB resource. Currently, that information is not available in InitializeCore. As per discussion, we are considering alternative options.
Yes, it is incorrect. The |
Co-authored-by: John Simons <john.simons@particular.net>
Updated the `BuildMetricsEndpoint` method to ensure the region is consistently formatted in lowercase when constructing the URI. Removed the unused `BuildMetricsEndpointFromAudience` method.
This change migrates from the deprecated
Azure.Monitor.Querypackage to the newAzure.Monitor.Query.Metricspackage as outlined within #5148.