fix(gasoline): bound traces from long-lived workflow loops
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 50/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
engine/packages/gasoline/src/builder/workflow/lupe.rs の284行目付近から始めます。ここでは workflow の反復処理が長期間存続する span を継承しています。周囲のループ計装を読み、その後 rustfmt --check と cargo check -p gasoline を実行します。各反復処理がそれぞれ固有の trace に限定され、同時に workflow span への因果関係が保持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Gasoline workflow loops can keep one OpenTelemetry trace ID for the full lifetime of a long-running workflow. Each loop iteration is instrumented as a child of the long-lived LoopBuilder::run / workflow span, so traces grow without a bound.
The current implementation is here:
Evidence
Observed with Rivet Engine 2.3.0-rc.5 in self-hosted staging and production:
- One block-only Tempo response contained 12,205 Rivet spans over 65 minutes and required 50,389,617 inspected bytes.
- The visible iteration counters were already 7,650–7,778, showing that the trace belonged to a much older workflow parent.
- The largest operation groups were
txn(2,046),txn_attempt(2,045), and four signal-listening operations (1,269 each). - Over 36 hours, Tempo emitted 247 oversized-trace warnings from 3 trace IDs in staging and 151 warnings from 39 trace IDs in production.
- The most repeated production trace had the same shape: 12,313 spans dominated by transaction and signal-loop operations.
- These traces repeatedly hit Tempo's trace-size guard during compaction and contributed to ingester/compactor memory pressure.
The current public main still has the same inherited iteration span, and I could not find an existing issue or PR for this behavior.
Suggested fix
Start each workflow iteration as a new root trace and preserve causality by linking it to the workflow span:
let parent_span_ctx = tracing::Span::current()
.context()
.span()
.span_context()
.clone();
let iteration_span =
tracing::info_span!(parent: None, "iteration", iteration=%previous_iteration);
iteration_span.add_link(parent_span_ctx);
let res = async {
// existing iteration body
}
.instrument(iteration_span)
.await?;
This bounds each trace to one workflow iteration while retaining a causal link to the long-lived workflow. I have this change locally and rustfmt --check plus cargo check -p gasoline pass.
- 主要言語
- Rust
- スター
- 6.3k
- フォーク
- 271
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 89
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rivet-dev/rivet のほかの issue
-
Rust client drops connection-level errors when actionId is null (JSON/CBOR)対応中かも @DibbayajyotiRoy が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rivet-dev/rivet#5819 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Queue docs say completable messages are removed on receive, but they stay stored until complete()対応中かも @Saisharathchandranandnetha が 17 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 91/100
rivet-dev/rivet#5762 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Serverless listener forwards /start to the application when basePath is "/"対応中かも @Saisharathchandranandnetha が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
rivet-dev/rivet#5755 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rivet-dev/rivet#5850 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
rivet-dev/rivet#5837 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
rivet-dev/rivet の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
element-hq/lk-jwt-service#248 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged bug bughunt pm:pipenv priority:p1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SocketDev/socket-patch#1219 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pact-foundation/pact-cli#154 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
antithesishq/bombadil#361 ·
メンテナーはふだん 1 日以内に返信