http.request.resend_count metric attribute subtracts 1 from 0-based attempt count

オープン 初心者向け
#6,706 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

src/gax-internal/src/observability/client_signals/transport_metric.rs の引用されたセクションを読み、http.rs と grpc_helpers.rs から渡される attempt_count を、http_tracing.rs で使用されている 0 ベースの値と比較します。初回リクエストと最初のリトライで、一貫した resend_count 属性が生成されることを確認します。メトリクスとスパンの解釈が一致すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

type: bug

Unconfirmed. This is the result of a search with Claude, may be a false positive.

In src/gax-internal/src/observability/client_signals/transport_metric.rs, the http.request.resend_count OpenTelemetry metric attribute is recorded with:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/gax-internal/src/observability/client_signals/transport_metric.rs#L118-L120

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/gax-internal/src/observability/client_signals/transport_metric.rs#L172-L175

Some((attempt_count.saturating_sub(1) as i64).into())

However, the calling retry loops in http.rs and grpc_helpers.rs pass an attempt_count that is already a 0-based prior-attempt count (0 on initial request, 1 on first retry):

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/gax-internal/src/http.rs#L391-L403

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/gax-internal/src/http.rs#L488-L494

Because saturating_sub(1) is applied to an already 0-based counter, both the initial request and the first retry record resend_count = 0. The attempt span in http_tracing.rs:72-76 treats the value as 0-based, causing the span attribute and metric attribute to disagree.

主要言語
Rust
スター
972
フォーク
163
平均マージ
1日 13時間
マージ済み PR(30日)
202

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleapis/google-cloud-rust のほかの issue

googleapis/google-cloud-rust の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。