[Feature Request] Support / provide guidance on using OpenTelemetry logging + metrics SDKs with process-pool workers
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #1017 来自 @gregbrowndev —— 已关闭,未合并
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 20/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python
调研方向
首先查看链接的 OpenTelemetry fork 进程文档和 samples-python open_telemetry/worker.py 示例,然后检查 TracingInterceptor 和 activity.metric_meter() 在 async 和 process-pool worker 中的行为。当项目为 async、thread-pool 和 process-pool worker 中的日志记录与自定义指标提供指导或原生支持时,该 issue 即完成。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
Hi,
I've been rolling out an OpenTelemetry-based observability solution for my Temporal app. The reason for using OTel is partly due to the Temporal Python SDK already using OTel for traces and metrics (in the SDK), so I want to adopt those SDKs for custom metrics and logging.
Everything works great in async activities. I've been able to use OTel tooling for logging and tracing (using the TracingInterceptor as seen in this example), I can see traces with their correlated logs for each activity in my backend (Grafana, Loki, Tempo). The Temporal SDK provides activity.metric_meter(), which I've used to add custom metrics to async activities.
However, I'm having several issues with sync activities running on process-pool-based workers (I'm happy to split them into separate issues):
The trace_id and span_id injected into the logs are incorrect for all except the first activity that runs on that worker. It seems that the first activity's IDs are injected into all activities that follow it.
- Temporal SDK's
activity.metric_meter()doesn't work in process-pools, which is clearly a known but probably related issue. I planned to set up a separate OTelMetricProviderto support custom metrics in my sync activities. However, this looks to have the same limitations (I haven't tried everything exhaustively yet).
Note: I suspect initialising the MeterProvider for each process/activity will be a lot more simple because it isn't attached to a global root logger.
While these issues are likely inherently within the OTel SDKs, the same issues are also known to be true for the TracingProvider (ref), yet Temporal managed to get that to work.
Please provide guidance on setting up OTel logging and custom metrics in process-pool-based workers or support them natively like you do OTel tracing.
Describe the solution you'd like
Support for the remaining OpenTelemetry SDKs (metric and logging) natively in both async, thread-pool, and process-pool workers.
- 主要语言
- Python
- 星标
- 1.3k
- 派生
- 305
- 平均合并
- 3 天 23 小时
- 30 天内合并 PR
- 44
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
temporalio/sdk-python 的其他 Issue
-
[Bug] Catching the ValueError from upsert_search_attributes (naive datetime) still leaves a workflow stuck retrying its task可能已有人在做 @VegetarianOrc 今天认领。 未关闭sdk-python
temporalio/sdk-python#2200 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug] Python: replayed Local Activity timeout causes NDE (TimeoutError not wrapped in ActivityError)可能已有人在做 @mjameswh 于 1 天前认领。 未关闭bug sdk-python
temporalio/sdk-python#2183 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug] workflow_streams: subscribe() raises RPCError when a publish signal lands during the continue-as-new workflow task可能已有人在做 @feiiiiii5 于 5 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 52/100
temporalio/sdk-python#2170 ·
维护者通常 1 天内回复
-
[Bug] Deadlock interruption can leak CPython's import lock and freeze the worker (still on Python 3.13/3.14)可能已有人在做 @tconley1428 于 21 天前认领。 未关闭sdk-python
难度 5/5 一周以上 新手友好度 25/100
temporalio/sdk-python#2115 ·
维护者通常 1 天内回复
-
Support custom peer identity verification while retaining standard TLS authentication可能已有人在做 @dzsquared 于 23 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 35/100
temporalio/sdk-python#2106 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 temporalio/sdk-python 的全部 Issue
相似的 Issue
-
area:print-dispatch
难度 2/5 1-3 小时 新手友好度 92/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area/geometry good first issue help wanted kind/doc-mismatch severity/4-minor
难度 2/5 1-3 小时 新手友好度 68/100
Apich-Organization/rssn#295 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
-
chore claimed
难度 2/5 1-3 小时 新手友好度 72/100
schuyler/corvidae#1424 · 2 条评论 ·
维护者通常 1 天内回复