Bug: nested subsegments don't work across threads
@srprash đang làm issue này rồi.
Từ ngày 28/9/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
We're tracking a bug where nested subsegments don't work across threads, even when using the official suggestion in the documentation.
We've managed to reproduce the issue with some minimal code:
Code snippet
from concurrent.futures import ThreadPoolExecutor
from aws_xray_sdk.core import xray_recorder
@xray_recorder.capture("## lambda handler")
def lambda_handler(event, context):
with ThreadPoolExecutor() as pool:
@xray_recorder.capture("## f")
def f():
@xray_recorder.capture("## h")
def h():
pass
def g(trace_entity):
xray_recorder.set_trace_entity(trace_entity)
h()
xray_recorder.clear_trace_entities()
curr = xray_recorder.get_trace_entity()
pool.submit(g, curr)
This produces the following XRay traces:
XRay trace
XRay Event at (2023-04-05T16:32:52.012000) with id (1-642d8694-731f0a1a6d204264677086db) and duration (0.388s)
- 0.388s - lambda-function-url-HelloWorldFunction-sRQB00cHvXOP [HTTP: 200]
- 0.021s - lambda-function-url-HelloWorldFunction-sRQB00cHvXOP
- 0.223s - Initialization
- 0.020s - Invocation
- 0.019s - ## lambda handler
- 0.018s - ## f
- 0.000s - ## h
- 0.000s - Overhead
The expected output would be for the "h" trace to be nested under "f":
Expected output
XRay Event at (2023-04-05T16:32:52.012000) with id (1-642d8694-731f0a1a6d204264677086db) and duration (0.388s)
- 0.388s - lambda-function-url-HelloWorldFunction-sRQB00cHvXOP [HTTP: 200]
- 0.021s - lambda-function-url-HelloWorldFunction-sRQB00cHvXOP
- 0.223s - Initialization
- 0.020s - Invocation
- 0.019s - ## lambda handler
- 0.018s - ## f
- 0.000s - ## h
- 0.000s - Overhead
- 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
- 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/aws-xray-sdk-python
-
psycopg connection context manager drops X-Ray tracing wrapper, so cursor execute calls are not tracedCó thể đã có người làm @reginaldalfret đã nhận 22 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
aws/aws-xray-sdk-python#490 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
aws/aws-xray-sdk-python#460 ·
-
Next releaseĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
aws/aws-xray-sdk-python#457 · 1 reaction ·
-
mysql-connector 9.2.0 - TypeError: 'MySQLConnection' object is not iterableCó thể đã có người làm @reginaldalfret đã nhận 22 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws/aws-xray-sdk-python#453 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
aws/aws-xray-sdk-python#452 · 1 reaction ·
Tất cả issue của aws/aws-xray-sdk-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
TomerAberbach/profiler-md#733 ·
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 68/100
its-me-prash/vwgroup-connect-ha#1858 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: client bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Deleting all alarms or timers shows deleted ones until the next update when there are none leftĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
leikoilja/ha-google-home#1107 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Graphify-Labs/graphify#4524 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày