(google-cloud-spanner) Built-in metrics fail when one process uses databases in different projects
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- google-cloud, python
- Lĩnh vực
- cloud, observability-sre
Hướng nghiên cứu
Bắt đầu bằng cách chạy ví dụ hai dự án được cung cấp với google-cloud-spanner 3.68.0 và kiểm tra đường dẫn metrics tích hợp được spanner.Client sử dụng. So sánh hành vi mặc định với SPANNER_DISABLE_BUILTIN_METRICS và Client(disable_builtin_metrics=True), sau đó truy vết cách project của client đầu tiên được sử dụng lại trong quá trình export. Hoàn thành khi metrics từ mỗi database đến được project riêng của nó mà không vô hiệu hóa metrics tích hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 5.4k
- Fork
- 1.8k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 143
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleapis/google-cloud-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-python#18532 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
googleapis/google-cloud-python#18467 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
auth priority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
googleapis/google-cloud-python#18428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
googleapis/google-cloud-python#18375 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci: enable --strict flag in presubmit twine_checkCó thể đã có người làm @ohmayr đã nhận 2 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
googleapis/google-cloud-python#18339 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của googleapis/google-cloud-python
Issue tương tự
-
[request] poppler-data/0.4.12Đang mởupstream update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conan-io/conan-center-index#31098 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
john-kurkowski/tldextract#382 ·
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#132042 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepset-ai/haystack#13092 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
feder-cr/invisible_playwright_mcp#1408 ·
Maintainer thường phản hồi trong vòng 1 ngày