Add optional OpenTelemetry tracing for subscription hydration
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- postgresql, rust
- 领域
- backend, observability
调研方向
Start by reading the observability documentation and the existing OTEL_* configuration and metrics/log export code; the issue does not name specific files. Map the subscription registration and initial hydration stages, including their asynchronous boundaries, before proposing a design. Done means opt-in traces cover hydration with context propagation, configurable sampling and nonblocking export, with tests and updated documentation and example configuration.
由索引模型根据 Issue 内容生成。
描述
Context
Streamgres already provides detailed Prometheus metrics and optional
OpenTelemetry export for metrics and logs. The observability documentation
also explicitly mentions that traces are not currently produced and that
OTEL_TRACES_EXPORTER is accepted but ignored.
The existing stage-level histograms are useful for identifying aggregate
latency, but it would also be useful to correlate the individual stages of
a subscription's initial hydration as one operation.
For example, when a subscription takes longer than expected to become
available, an individual trace could make it easier to distinguish time
spent in query transformation, planning, storage reads and hydration.
Proposed enhancement
It would be useful to explore adding opt-in OpenTelemetry trace export,
starting with the subscription registration and initial hydration lifecycle.
A trace could connect the relevant stages:
- Receiving the subscription request.
- Transforming and planning the query.
- Issuing the required storage reads.
- Landing the reads in the engine.
- Completing subscription hydration.
- Delivering the initial result to the client group.
The first iteration does not necessarily need to trace every transaction,
row update or feed operation. A focused subscription-hydration path would
already provide a useful starting point.
Design considerations
A few constraints seem particularly important for this project:
- Tracing should remain disabled by default and should be explicitly
configurable through the existingOTEL_*configuration approach. - Trace context should be preserved across the asynchronous and
thread/channel boundaries involved in the subscription lifecycle. - Sampling should be configurable so high-volume workloads do not produce
an unnecessarily large number of spans. - Span export should happen outside the engine and client-serving hot paths.
A bounded queue and dedicated export worker would be worth considering. - A slow or unavailable collector must not block payment-independent
synchronization work or the threads serving clients. - Dropped spans and export failures should be observable.
- Span attributes should avoid SQL literals, row contents, user data,
credentials and other sensitive information.
Acceptance criteria
-
OTEL_TRACES_EXPORTERcan explicitly enable or disable trace export. - Trace endpoint configuration follows the existing OTLP configuration
approach, including support for a dedicated traces endpoint. - A subscription's initial hydration can be represented by a trace
spanning the relevant processing stages. - Trace context is preserved where the lifecycle crosses asynchronous
tasks or thread/channel boundaries. - Sampling and bounded buffering prevent tracing from introducing
blocking work into the engine or client-serving paths. - Collector failures and dropped spans are handled without affecting
synchronization behaviour. - Tests cover configuration, trace encoding, context propagation and
export failure or queue saturation. - Existing metrics and log export behaviour remains unchanged.
- The observability documentation and example configuration are updated.
Discussion
I would be interested in contributing an initial implementation of this
capability. Before starting, it would be useful to understand whether
maintainers would prefer a focused hydration trace first or a broader
subscription-lifecycle tracing design.
- 主要语言
- Rust
- 星标
- 129
- 派生
- 7
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
juspay/streamgres 的其他 Issue
-
Make the top-L client diff cost depend on what changed, not on the limit可能已有人在做 @SahilKhan101 于 4 天前认领。 未关闭enhancement
juspay/streamgres#64 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Query optimisation: share initial snapshots across LIMIT variants of the same query (donor windows)可能已有人在做 @sprihaanand-juspay 于 5 天前认领。 未关闭
juspay/streamgres#58 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 4/5 一周以上 新手友好度 38/100
juspay/streamgres#56 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
juspay/streamgres#55 ·
维护者通常 1 天内回复
-
PgBouncer transaction pooling: `prepare` runs outside the read transaction and can land on another backend可能已有人在做 @sprihaanand-juspay 于 8 天前认领。 未关闭
juspay/streamgres#53 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 juspay/streamgres 的全部 Issue
相似的 Issue
-
claim
难度 2/5 1-3 小时 新手友好度 88/100
Nixitov/Riptide-Native#946 ·
维护者通常 1 天内回复
-
area: ai-assistants documentation help wanted
难度 2/5 1-3 小时 新手友好度 78/100
BetaBots-LLC/latticegate#17 ·
-
难度 1/5 1 小时以内 新手友好度 94/100
storytold/craft-libs#5594 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
LingyunStudio/RustMusic#16 ·