(google-cloud-spanner) Built-in metrics fail when one process uses databases in different projects
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- google-cloud, python
調査の方向性
まず、google-cloud-spanner 3.68.0 を使用して、提供されている 2 プロジェクトの例を実行し、spanner.Client が使用する組み込みメトリクスのパスを調べます。デフォルトの動作を SPANNER_DISABLE_BUILTIN_METRICS および Client(disable_builtin_metrics=True) と比較し、その後、エクスポート中に最初のクライアントのプロジェクトがどのように再利用されるかを追跡します。組み込みメトリクスを無効にせずに、各データベースのメトリクスがそれぞれのプロジェクトに届けば完了です。
索引モデルが issue の本文から書いたものです。
説明
Environment details
- OS type and version: Linux (also happens on macOS)
- Python version: 3.13
google-cloud-spannerversion: 3.68.0
Steps to reproduce
- In one process, create two clients for databases in two different projects.
- Run a query on each.
- Wait a minute for the metrics export.
Code example
from google.cloud import spanner
a = spanner.Client(project="project-a")
b = spanner.Client(project="project-b")
a.instance("i").database("d").snapshot().execute_sql("SELECT 1")
b.instance("i").database("d").snapshot().execute_sql("SELECT 1")
What happens
The metrics export fails, and no metrics show up in Cloud Monitoring for either project:
InvalidArgument: 400 Field resource.labels.project_id had an invalid value of
"project-b": if present, must be the project number or ID in the request name
(projects/project-a).
Whichever client is created first decides where all metrics go, so everything from the other project is rejected — and it takes the first project's metrics down with it, since they're sent in the same request.
What I expected
Metrics for each database go to that database's project. Running against several projects is pretty normal, and right now it means no built-in metrics at all.
What I tried
SPANNER_DISABLE_BUILTIN_METRICS=true and Client(disable_builtin_metrics=True) both work, but only by giving up the metrics. As far as I can tell there's no way to pass in my own exporter or meter provider, so there's no way to keep them. Java has this (googleapis/google-cloud-java#13679) and there's an open request for Go (googleapis/google-cloud-go#11204), but I couldn't find anything similar here.
- 主要言語
- Python
- スター
- 5.4k
- フォーク
- 1.8k
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 102
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleapis/google-cloud-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
googleapis/google-cloud-python#18428 ·
-
priority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
googleapis/google-cloud-python#18375 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
googleapis/google-cloud-python#18339 ·
-
auth priority: p2
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
googleapis/google-cloud-python#18315 ·
-
priority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/google-cloud-python#18260 ·
googleapis/google-cloud-python の issue をすべて見る
似ている issue
-
link-check link-check:sphinx-theme
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
CSCfi/sd-search-api#39 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100