Skip to content

Instantly share code, notes, and snippets.

@chasingmaxwell
Last active March 10, 2022 03:50
Show Gist options
  • Save chasingmaxwell/20c2e9c5dbb4035916fffca67ab212bf to your computer and use it in GitHub Desktop.
Save chasingmaxwell/20c2e9c5dbb4035916fffca67ab212bf to your computer and use it in GitHub Desktop.
AWS CloudWatch Insight Queries
filter @type = "REPORT"
| stats
avg(@billedDuration) as Average,
percentile(@billedDuration, 99) as NinetyNinth,
percentile(@billedDuration, 95) as NinetyFifth,
percentile(@billedDuration, 90) as Ninetieth
by bin(30m)
filter @type = "REPORT"
| stats
max(@maxMemoryUsed / 1024 / 1024) as maxMemoryMB,
avg(@maxMemoryUsed / 1024 / 1024) as avgMemoryMB,
min(@maxMemoryUsed / 1024 / 1024) as minMemoryMB,
(avg(@maxMemoryUsed / 1024 / 1024) / max(@memorySize / 1024 / 1024)) * 100 as avgMemoryUsedPERC,
avg(@billedDuration) as avgDurationMS
by bin(30m)
filter @type = "REPORT" and @maxMemoryUsed=@memorySize
| stats
count_distinct(@requestId)
by bin(30m)
filter @message like /Process exited/
| stats count() by bin(30m)
filter @message like /Task timed out/
| stats count() by bin(30m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment