Last active
July 28, 2022 03:05
-
-
Save binura-g/aab92ff1efe6179a32b2da36cf69cf07 to your computer and use it in GitHub Desktop.
Kusto AKS Example - latency percentiles with structured JSON logs
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
let _Namespace = "namespace_name"; | |
let _ServiceName = "deployment_name"; | |
KubePodInventory | |
| where Namespace == _Namespace | |
| where ContainerName has_cs _ServiceName | |
| distinct ContainerID | |
| join kind=inner ContainerLog on ContainerID | |
| where LogEntry has '"type":"http-access"' // filtering out only the http access logs | |
| extend parsedLog=parse_json(LogEntry) | |
| extend latencyMs=todouble(parsedLog.responseTimeMs), | |
method=tostring(parsedLog.method) | |
| summarize percentiles(latencyMs, 99, 90, 50) by method; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment