[FR] Expose retry-attempt observability (hook/event) — retried 503s and per-attempt latency are invisible to callers
I maintainer di solito rispondono entro 7 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 28/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- nodejs, typescript
- Ambito
- api, observability
Direzione di ricerca
Inizia dal comportamento di ritentativo indicato nel commento del codice api-request e analizza le opzioni di messaggistica o dell’app discusse nella richiesta, insieme alla issue correlata #1615. Il lavoro è completato quando i chiamanti possono osservare i tentativi di ritentativo, i dettagli dello stato o dell’errore, il tempo trascorso e se verrà effettuato un altro ritentativo, senza applicare patch agli internals di HTTP/2.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem?
The HTTP clients retry transient failures — per the code comment in api-request, "Retries up to 4 times on connection reset and timeout errors as well as 503 errors" — which is great, but the retry lifecycle is completely invisible to the caller. You observe only the final result and total elapsed time.
In production this matters a lot for FCM:
- A
sendEach()call that "took 15s" is indistinguishable from one that made three 5s attempts. Capacity planning, SLO attribution, and incident analysis need to tell these apart. - 503s that the SDK retries away never appear anywhere. During an FCM backend hiccup, our error rate looked flat while the wire was full of retried 503s — we only learned this after instrumenting below the SDK.
What we did as a workaround (and what it revealed)
We attached listeners at the HTTP/2 layer to record, per attempt, the :status header the SDK already receives, plus per-attempt request→response duration. Two things became visible immediately:
- Swallowed 503s during backend episodes (invisible at the SDK surface).
- Batches with ~15s total latency decomposed cleanly into 3 × ~5s attempts — i.e. the tail was retry behavior, not slow single requests.
We validated the accounting at scale: in a ~650k-message load run at ~2,000 rps, wire-level attempt counts reconciled exactly with SDK-level result counts (596,663 = 596,663).
Monkey-patching works but is version-fragile and clearly not the intended way.
Describe the solution you'd like
Any of these would solve it (in rough order of preference):
- An
onRetryAttempt(info)callback / EventEmitter on the messaging or app options, with{ attempt, statusCode?, errorCode?, elapsedMs, willRetry }. - Attempt metadata attached to the final response/error (e.g.
attempts: [{status, elapsedMs}, ...]). - At minimum, a debug logging hook for retry decisions.
Describe alternatives you've considered
- Runtime-patching the HTTP/2 request path to observe response headers (works, but couples us to SDK internals).
enableLegacyHttpTransport()+ external proxy metrics (gives up HTTP/2).
Additional context
Related: #1615 (custom RetryConfig) — configuration and observability of the same mechanism. Verified against 12.7.0 and 14.1, on Node 16 and 24.
- Lingua principale
- TypeScript
- Stelle
- 1.8k
- Fork
- 420
- Merge medio
- 5g 6h
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/firebase-admin-node
-
Password policy violation is reported as `auth/internal-error` instead of a specific error codeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
firebase/firebase-admin-node#3265 ·
I maintainer di solito rispondono entro 7 giorni
-
getToken() replays a failed token refresh to later callers while a valid token is cachedForse già presa @GUMBOKIM l’ha presa 50 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
firebase/firebase-admin-node#3234 ·
I maintainer di solito rispondono entro 7 giorni
-
[email protected] stable dependency tree fails npm audit via Storage uuid and Firestore google-gaxForse già presa @lahirumaramba l’ha presa 26 giorni fa. Aperta
firebase/firebase-admin-node#3221 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 7 giorni
-
Misleading error message for THIRD_PARTY_AUTH_ERROR: raw "OAuth 2 access token" text surfaced instead of the APNs-specific messageForse già presa @milcho0604 l’ha presa 52 giorni fa. Apertaapi: messaging
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
firebase/firebase-admin-node#3215 ·
I maintainer di solito rispondono entro 7 giorni
-
[Firestore] Re-export functions from '@google-cloud/firestore/pipelines'Forse di nuovo libera @jonathanedey l’ha presa 96 giorni fa e non c’è nessuna pull request aperta. Apertaapi: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 7 giorni
Tutte le issue di firebase/firebase-admin-node
Issue simili
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
lingdojo/kana-dojo#31666 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Bug: lockTtlSeconds / lockHeartbeatIntervalSeconds accept non-positive and non-finite valuesForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
CopilotKit/CopilotKit#7618 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
wimpysworld/sidra#287 ·
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sleeyax/paseo-plugins#112 ·
I maintainer di solito rispondono entro 2 giorni