Issue with passing trace_entity when using ThreadPoolExecutor in lambda
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- aws, python
调研方向
从 README 的 ThreadPoolExecutor 示例开始,检查用于 lambda 的自定义上下文类,尤其是 trace entity 的初始化和设置方式。重现线程处理的第一个 job,并验证其 subsegment 会附加到所提供的 trace entity,而无需预先调用 get_trace_entity。
由索引模型根据 Issue 内容生成。
描述
I followed the instructions in the readme for passing the trace entity in a ThreadPoolExecutor but this does not appear to work properly in a lambda. The first time a thread does some work the trace_entity does not stick and the subsegment gets put under the root node not the one it should be assiciated with. The next time a thread picks up a job everything seems to operate fine.
I dug into the code a bit and it seems like there is a custome context class for lambdas but it does not override set_trace_entity to work properly with the other changes in the class. To workaround the issue I have found calling get_trace_entity before setting sets the internal state up properly.
example workaround from readme
def load_url(url, trace_entity):
xray_recorder.get_trace_entity() # Workaround to setup internal state
xray_recorder.set_trace_entity(trace_entity)
resp = requests.get(url)
xray_recorder.clear_trace_entities()
return resp
- 主要语言
- Python
- 星标
- 340
- 派生
- 148
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws/aws-xray-sdk-python 的其他 Issue
-
psycopg connection context manager drops X-Ray tracing wrapper, so cursor execute calls are not traced可能已有人在做 @reginaldalfret 于 22 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
aws/aws-xray-sdk-python#490 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 1/100
aws/aws-xray-sdk-python#460 ·
-
Next release未关闭
难度 5/5 一周以上 新手友好度 20/100
aws/aws-xray-sdk-python#457 · 1 个 reaction ·
-
mysql-connector 9.2.0 - TypeError: 'MySQLConnection' object is not iterable可能已有人在做 @reginaldalfret 于 22 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
aws/aws-xray-sdk-python#453 ·
-
难度 4/5 3-5 天 新手友好度 35/100
aws/aws-xray-sdk-python#452 · 1 个 reaction ·
查看 aws/aws-xray-sdk-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
omegaup/omegaup#10353 · 1 条评论 ·
维护者通常 5 天内回复
-
bot-triaged module: LrScheduler module: optimizer triaged
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
documentation glm5 llm-model
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/vllm-ascend#19062 ·
维护者通常 1 天内回复
-
author-page correction
难度 2/5 1-3 小时 新手友好度 68/100
acl-org/acl-anthology#10496 · 1 条评论 ·
维护者通常 1 天内回复