Created
August 8, 2023 04:08
-
-
Save sasasin/f56cb6ea7f95a84aa518a77383f785ea to your computer and use it in GitHub Desktop.
AWS Lambda Fn のメモリ使用量を CloudWatch Logs Insight で調べるやつ
This file contains 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
# CloudWatch Logs Insights で調べたいロググループと時間範囲を選んで、以下クエリを実行する。 | |
# bin(24h) は 24h 単位に集約して集計しろという指定。調べたい期間に書き換えて実行する。5m とか 8h とか 2d とか | |
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax-Stats.html | |
fields @timestamp, @message, @logStream, @log | |
| filter @type = "REPORT" | |
| stats min(@maxMemoryUsed), avg(@maxMemoryUsed), max(@maxMemoryUsed) by bin(24h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment