-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Azure monitor's list metrics for cpu_percent always returns 0.0 for sql database resources #38252
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @gulopesd @Haiying-MSFT @jairmyree @joshfree @KarishmaGhiya @KevinBlasko @kurtzeborn @nisha-bhatia @pvaneck @sarangan12 @scottaddie @srnagar @ToddKingMSFT. |
@ChenxiJiang333 Please help on this issue. |
got it |
Hi @ben-vega, somehow it works with me by passing your parameters. I guess one of the possible reasons is the |
Hi @ben-vega. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
Hi @ChenxiJiang333 thanks for getting back to me. I tried it without providing a timeframe, and it responded with the most recent hour but I still got 0's for all databases in my resource group. I wonder if there is something else at play here outside of code, like is there a "setting" I need to enable to allow azure to collect this information? Is there restrictions on what "type" of sql database has this information? Maybe there needs to be a permission added to the client I am authorizing with? I've looked around the internet a fair bit with no luck so far, if you could point me in the right direction I would appreciate it. Here is the debug logs with the version from the request (please let me know if this is not what you were looking for) and here is my python code so we are working with the same codebase.
|
Hi @ben-vega, have you tried to update your databases like adding some new tables or new columns before you list the cpu percent? |
Hi @ben-vega. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
@ChenxiJiang333 I added 10000 rows to my table and I finally got non 0's back. This seems like something I should have figured out myself, thank you for your replies. I guess I assumed there would be some number returned even if it wasn't very much usage. Is there a threshold where the api only reports back a cpu percent if there is enough activity to report? For example if the actual cpu percent is something really small like 0.0005% the api will respond with 0.0 until it reaches 0.01% actual utilization then the api will report back there is 0.01% utilization |
Describe the bug
Issue getting
cpu_percent
metric for Sql database resource types. The API always returns a value of 0.0 regardless of resource, aggregation. or timeframe. If others are unable to reproduce or there is something I missed, any insight would be greatly appreciated,To Reproduce
Steps to reproduce the behavior:
Expected behavior
An API response with hourly metric data on cpu_percent of the database. Instead, I always get "0.0" back for the cpu_percent at every interval. I have tried different databases, different subscription, different aggregations, different intervals, the only aggregation that gives me a number back is "count" for obvious reasons. I've had a couple others look at my code as well and can't find anything wrong either.
Screenshots
n/a
Additional context
This problem seems to be larger than just the python-sdk, the azure CLI also always returns 0.0 for cpu_percent of sql databases. There are several metric types that do give actual numbers when i pass a different metricnames value, for example 'sql_instance_memory_percent' gives real numbers and works as expected. However, there are several that always return 0.0 or null. My database is not off over the interval where I am asking for metrics, This is further supported by the fact that I get "real" data back for other metricnames when I use them in the same call as cpu_percent (for example using metricnames="cpu_percent,sql_instance_memory_percent". I understand that depending on the resource type there might be different metrics available, however according to docs here there aren't any limits mentioned for that metric type. Also, the fact that using unsupported metric types in the list call throws an error further leads me to believe that the issue is not due to passing the wrong value for 'metricnames' parameter.
The text was updated successfully, but these errors were encountered: