[Lambda][CloudWatch] Memory Usage as a CloudWatch Metric
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 196
- Fork
- 5
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
Adding Lambda memory usage as a CloudWatch metric would enable users to create alarms on memory usage, allowing proactive adjustments to memory allocation before encountering errors. It would also simplify monitoring this critical parameter by making memory usage directly visible in the Monitoring section of the Lambda console.
This enhancement would improve visualization of memory usage and facilitate better handling of memory-related issues (e.g., insufficient memory) before they result in errors.
**Which service(s) is this request for?**
AWS Lambda
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Currently, there are no direct metrics for memory usage in CloudWatch. Users must rely on CloudWatch Logs Insights queries to extract memory usage data, which adds complexity and is less user-friendly.
**Are you currently working around this issue?**
To monitor memory usage, we need to navigate to Monitoring, then CloudWatch Logs, and execute a Logs Insights query such as:
```
filter @type = "REPORT"
| stats max(@memorySize / 1000 / 1000) as provisionedMemoryMB,
min(@maxMemoryUsed / 1000 / 1000) as smallestMemoryRequestMB,
avg(@maxMemoryUsed / 1000 / 1000) as avgMemoryUsedMB,
max(@maxMemoryUsed / 1000 / 1000) as maxMemoryUsedMB,
provisionedMemoryMB - maxMemoryUsedMB as overProvisionedMB
```
Alternatively, memory usage information can be found in "Recent invocations" and "Most expensive invocations in GB-seconds (memory assigned * billed duration)." However, these methods are not the most user-friendly or efficient for monitoring memory usage.
**Additional context**
N/A
**Attachments**
N/A
Hướng dẫn đóng góp
Hướng nghiên cứu
Issue không đề cập đến tệp repository, test hoặc entry point của code. Hãy bắt đầu bằng việc xem xét các khả năng về metric của AWS Lambda và CloudWatch được mô tả tại đây, sau đó xác định định nghĩa metric và đường dẫn tích hợp cần thiết. Được xem là hoàn tất khi mức sử dụng bộ nhớ của Lambda khả dụng dưới dạng metric CloudWatch và có thể được sử dụng để monitoring và alarms.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws
- Lĩnh vực
- cloud, observability
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100