Created
August 7, 2024 07:48
-
-
Save stuarthallows/8e5f296436c4d68dcf0b2e5e65495214 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Top slowest endpoints by 95th percentile | |
requests | |
| where timestamp > ago(7d) | |
| summarize avg_duration=avg(duration), percentiles(duration, 50, 95, 99), RequestCount=count() by name, cloud_RoleName | |
| top 25 by percentile_duration_95 | |
| project endpoint=name, cloud_RoleName, avg=round(avg_duration), p50=round(percentile_duration_50), p95=round(percentile_duration_95), p99=round(percentile_duration_99), RequestCount | |
| order by p95 desc | |
// Top 10 slowest endpoints by average duration | |
requests | |
| where timestamp > ago(7d) | |
| summarize avg_duration=avg(duration), percentiles(duration, 50, 95, 99), RequestCount=count() by name, cloud_RoleName | |
| top 25 by percentile_duration_95 | |
| project endpoint=name, cloud_RoleName, avg=round(avg_duration), p50=round(percentile_duration_50), p95=round(percentile_duration_95), p99=round(percentile_duration_99), RequestCount | |
| order by avg desc | |
// Endpoints with highest failure rate | |
requests | |
| where timestamp > ago(7d) | |
| summarize failure_count=countif(success == false), total_count=count(), avg_duration=avg(duration), percentiles(duration, 50, 95, 99) by name | |
| extend failure_rate = (todouble(failure_count) / total_count) * 100 | |
| top 10 by failure_rate | |
| project endpoint=name, failure_rate, failure_count, total_count, avg_duration, duration_p50=percentile_duration_50, duration_p95=percentile_duration_95, duration_p99=percentile_duration_99 | |
| order by failure_rate desc, failure_count desc | |
// Trend of response times over for top 5 slowest endpoints | |
let time_period = 28d; | |
let slow_endpoints = | |
requests | |
| where timestamp > ago(time_period) | |
| summarize percentiles(duration, 95) by name | |
| top 5 by percentile_duration_95 | |
| project name; | |
requests | |
| where timestamp > ago(time_period) | |
| where name in (slow_endpoints) | |
| summarize avg_duration=avg(duration), percentiles(duration, 50, 95, 99) by bin(timestamp, 1h), name | |
| render timechart | |
// Count of requests per 30 minutes | |
requests | |
| where timestamp > ago(7d) | |
| summarize totalCount=sum(itemCount) by bin(timestamp, 30m) | |
| render timechart | |
// Chart request count by response time performance-bucket | |
requests | |
| where timestamp > ago(7d) | |
| summarize requestCount=sum(itemCount), avgDuration=avg(duration) by performanceBucket | |
| order by avgDuration asc // sort by average request duration | |
| project-away avgDuration // no need to display avgDuration, we used it only for sorting results | |
| render barchart | |
// Chart request count by service | |
requests | |
| where timestamp > ago(7d) | |
| summarize Count=count() by cloud_RoleName | |
| order by Count | |
| render columnchart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment