Bug: `log_uncaught_exceptions` only works locally and not on lambda
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- aws, python
- Lĩnh vực
- documentation, observability-sre
Hướng nghiên cứu
Start by locating the documentation for Logger(log_uncaught_exceptions=True) and reviewing the discussion about why the behavior differs in AWS Lambda. Reproduce the provided handler in an actual Lambda runtime and compare its output with local execution. The change is complete when the documentation clearly states which environments support this option and explains the observed unstructured output; confirm the project’s documentation build or relevant checks if available.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected Behaviour
When log_uncaught_exceptions=True, uncaught exceptions in a lambda are handled and transformed to a structured log.
Current Behaviour
Uncaught exceptions are printed unstructured.
Code snippet
from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities.typing import LambdaContext
logger = Logger(log_uncaught_exceptions=True)
def lambda_handler(event: dict, context: LambdaContext) -> str:
raise(Exception("asdf"))
Possible Solution
Probably none. Document this behavior.
I don't think sys.excepthook can be overridden in a lambda container, but I have no proof because the original forum thread that details this has been deleted by AWS with no replacement.
Steps to Reproduce
Set log_uncaught_exceptions=True in an actual running lambda. If log_uncaught_exceptions=True on a local machine, the behavior runs just as intended.
AWS Lambda Powertools for Python version
latest
AWS Lambda function runtime
3.9
Packaging format used
Lambda Layers
Debugging logs
No response
- Ngôn ngữ chính
- Python
- Star
- 3.3k
- Fork
- 511
- Merge trung bình
- 3 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 93
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws-powertools/powertools-lambda-python
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocationCó thể đã có người làm @lechakrawarthy đã nhận hôm nay. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aws-powertools/powertools-lambda-python#8728 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aws-powertools/powertools-lambda-python#8727 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
aws-powertools/powertools-lambda-python#8726 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
aws-powertools/powertools-lambda-python#8725 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key valueCó thể đã có người làm @sumedh-aerram đã nhận hôm nay. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
aws-powertools/powertools-lambda-python#8724 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của aws-powertools/powertools-lambda-python
Issue tương tự
-
good first issue test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
ANCORATE/EncryptHome#8 ·
-
PluginProvider.storeInstance races and clobbers the dedup cache for concurrent loadsCó thể đã có người làm @Wilson0511 đã nhận hôm nay. Đang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Bug: failed Together chat calls do not record operation duration or error.typeCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
community documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100