Azure-Samples / monitor-dotnet-metrics-api

Code sample of the Azure Monitor metrics API using the .Net SDK
MIT License
13 stars 10 forks source link

Is there any other way to get metrics #7

Open yogeshprasad opened 1 year ago

yogeshprasad commented 1 year ago

I am trying to build a client application which lists metrics for a resource. Here I am first making the call to get the metric definition for a resource and using the metric definition I am making calls to get the metrics.

The issue with this approach here is When I will have millions of resources in azure at that time making millions of API calls to get the metric definition will cost a lot.

can anyone help me out here to optimize this solution which works well in a larger environment?

as I don't want to make the API call again and again for a similar type of resource. I am looking for something like just getting the metric definition for one resource under the resource type and using that for all the resources which belong to the one resource type. but i have seen in some cases metrics differ for the resources under same resources type.