Use percentiles function on Azure Metrics

%3CLINGO-SUB%20id%3D%22lingo-sub-179523%22%20slang%3D%22en-US%22%3EUse%20percentiles%20function%20on%20Azure%20Metrics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-179523%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20am%20trying%20to%20modify%20this%20default%20query%20to%20give%20me%20the%20percentiles%20of%20DTU%20usage%20for%20my%20Azure%20SQL%20Database.%20Any%20idea%20how%20I%20can%20go%20about%20that%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAzureMetrics%3CBR%20%2F%3E%7C%20where%20ResourceProvider%3D%3D%22MICROSOFT.SQL%22%20and%20ResourceId%20contains%20'...'%3CBR%20%2F%3E%7C%20where%20MetricName%3D%3D'dtu_consumption_percent'%3CBR%20%2F%3E%7C%20summarize%20avg%20%3D%20min_of(avg(Maximum)%2C%20100.0)%2C%20max%20%3D%20min_of(max(Maximum)%2C%20100.0)%20by%20bin(TimeGenerated%2C%20time(14m))%3CBR%20%2F%3E%7C%20sort%20by%20TimeGenerated%20desc%3CBR%20%2F%3E%7C%20render%20timechart%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-179523%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%20Insights%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EQuery%20Language%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-180474%22%20slang%3D%22en-US%22%3ERe%3A%20Use%20percentiles%20function%20on%20Azure%20Metrics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-180474%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20Larissa%2C%3C%2FP%3E%0A%3CP%3Etry%20%3CA%20href%3D%22https%3A%2F%2Fportal.loganalytics.io%2Fsubscriptions%2Fe4272367-5645-4c4e-9c67-3b74b59a6982%2Fresourcegroups%2FContosoAzureHQ%2Fworkspaces%2Fcontosoretail-IT%3Fq%3DH4sIAAAAAAAAA1WOSwvCMBCE74L%252FYfFiC0VUFPHQgwiKYH3fJaYDBkwim8QX%252FnhTFcTTsLPfDDN6BEYBz0q6eu1J1yMYtIGzgSVWbC%252BqBOd5o5iNN8vtcrJrbdfzxg%252F9ZBdCI8%252BbpQ97aY0L%252BuyVNfszYonxzQqPphasHqCvq05wSSFuSgedUbefUb%252Bd0SDqcJjS4U4HZZKd0pjCgIVHmZGPZ9Lp6TR9V1r2FfgHUQknqy%252FDxOnviDwK9i%252FbZDij6wAAAA%253D%253D%26amp%3Btimespan%3DP1D%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%20query%3C%2FA%3E%2C%20it%20calculates%20percentiles%20of%20the%20%22Maximum%22%20value%3A%3C%2FP%3E%0A%3CPRE%3EAzureMetrics%0A%7C%20where%20ResourceProvider%3D%3D%22MICROSOFT.SQL%22%0A%7C%20where%20MetricName%3D%3D'dtu_consumption_percent'%0A%7C%20summarize%20percentiles(Maximum%2C%2025%2C%2050%2C%2075%2C%2099)%20by%20bin(TimeGenerated%2C%20time(14m))%0A%7C%20sort%20by%20TimeGenerated%20desc%0A%7C%20render%20timechart%3C%2FPRE%3E%0A%3CP%3EHTH%2C%3C%2FP%3E%0A%3CP%3ENoa%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Microsoft

Hello,

 

I am trying to modify this default query to give me the percentiles of DTU usage for my Azure SQL Database. Any idea how I can go about that?

 

AzureMetrics
| where ResourceProvider=="MICROSOFT.SQL" and ResourceId contains '...'
| where MetricName=='dtu_consumption_percent'
| summarize avg = min_of(avg(Maximum), 100.0), max = min_of(max(Maximum), 100.0) by bin(TimeGenerated, time(14m))
| sort by TimeGenerated desc
| render timechart

 

 

Thank you!

 

 

1 Reply
Highlighted

Hey Larissa,

try this query, it calculates percentiles of the "Maximum" value:

AzureMetrics
| where ResourceProvider=="MICROSOFT.SQL"
| where MetricName=='dtu_consumption_percent'
| summarize percentiles(Maximum, 25, 50, 75, 99) by bin(TimeGenerated, time(14m))
| sort by TimeGenerated desc
| render timechart

HTH,

Noa