Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

changing lambda segment immutability

Đang mở
#308 2 bình luận 4 reaction 1 người được giao Xem trên GitHub

@bhautikpip đang làm issue này rồi.

Từ ngày 20/7/2021.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

enhancement

It would be a nice feature if you had the ability to mutate segments in lambda handlers.

With the immutability limitation, it renders the service map error visibility useless if we're catching all exceptions in our lambda handler but still want to display the exception on the corresponding node in the graph.

For example, lets say you have the following design pattern:

Lambda handler that catches all exceptions and returns a response no matter what, this way, the client is always expecting a response value from the handler, regardless if an exception is raised.

If the segments in lambdas weren't immutable, we could get the current segment from the xray_recorder and call the add_exception method to attach the exception to the segment, thus, reflecting the error on the segment node in the graph.

Right now, all we can do is add the exception to the current subsegment, which still helps when inspecting the trace, but from a visual perspective, the map won't show any errors.

I'm aware of using API gateway with the handler, and returning a 4xx http response when we catch our exception. This improves visibility somewhat, because the client and api gateway nodes flag the errors, but still the lambda node will be healthy.

Also, this forces us to use API gateway to handle this design pattern, which we might not want to use.

We'd really like this change at my place of work for our current use case.

Ngôn ngữ chính
Python
Star
340
Fork
148
Merge trung bình
7 ngày 8 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/aws-xray-sdk-python

Tất cả issue của aws/aws-xray-sdk-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.