Record streaming attempt and front-end metrics when PartialResultSet.last=True is observed
Maintainer antworten meist innerhalb von 1 Tag
@olavloite arbeitet bereits daran.
Seit 13.10.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Description
In google-cloud-spanner, streaming queries that receive PartialResultSet.last = True hand off the underlying response iterator to _GLOBAL_STREAM_DRAINER to drain trailing metadata to EOF asynchronously on a background worker thread (in snapshot.py).
However, _StreamingResponseWrapper in metrics_interceptor.py currently defers recording attempt completion (attempt_latencies) and front-end timing metrics (gfe_latencies, afe_latencies) until StopIteration is raised:
https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-spanner/google/cloud/spanner_v1/metrics/metrics_interceptor.py
This causes two issues:
- Metric Timing Inaccuracy: Attempt latency should measure when the operation actually completes from an outside observer's perspective (i.e. when
PartialResultSet.last = Trueis received by the caller), rather than including time spent waiting in the background drainer queue or consuming trailing stream metadata. - Race Condition with Metrics Readers: Callers that complete a query and immediately collect or inspect metrics observe missing
attempt_latencies,gfe_latencies, andafe_latenciesbecause the background drainer thread has not yet reached EOF.
Proposed Solution
The client should measure attempt completion and record front-end metrics as soon as PartialResultSet.last == True is observed on the stream, rather than waiting for StopIteration during background stream draining.
- Vorherrschende Sprache
- Python
- Sterne
- 5.4k
- Forks
- 1.8k
- Ø Merge
- 2 T. 7 Std.
- Gemergte PRs (30 T.)
- 173
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus googleapis/google-cloud-python
-
firestore: field path with a quoted name ending in a backslash is misparsedEvtl. vergeben @sebxt hat das vor 25 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
googleapis/google-cloud-python#18771 ·
Maintainer antworten meist innerhalb von 1 Tag
-
api: spanner type: feature request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
googleapis/google-cloud-python#18584 ·
Maintainer antworten meist innerhalb von 1 Tag
-
auth: `impersonated_credentials` loses `subject` on copy, so `with_scopes()` and `with_quota_project()` turn off domain wide delegationEvtl. vergeben @Om-singhaI hat das vor 55 Tagen übernommen. Offenauth priority: p2 type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
googleapis/google-cloud-python#18428 ·
Maintainer antworten meist innerhalb von 1 Tag
-
A client called `run_in_transaction` be stuck if Spanner is downEvtl. vergeben @founderinaction hat das vor 7 Tagen übernommen. Offenpriority: p2 type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
googleapis/google-cloud-python#18375 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
ci: enable --strict flag in presubmit twine_checkEvtl. wieder frei @ohmayr hat das vor 44 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
googleapis/google-cloud-python#18339 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in googleapis/google-cloud-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
cpp-best-practices/project_validator#267 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Project-N-E-K-O/N.E.K.O#3725 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] Sending a Telegram message chain twice duplicates mentionsEvtl. vergeben @123XieC hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
AstrBotDevs/AstrBot#11125 ·
Maintainer antworten meist innerhalb von 1 Tag
-
backend bug priority: high
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
nooriegarg/ContribIQ#73 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug p3 security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
amd/gaia#8197 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag