Add `diagnostics_channel` support for query and connection lifecycle events
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, node.js, postgresql
- Ambito
- backend, observability-sre
Direzione di ricerca
La issue nomina pg e pg-pool, ma non include file di implementazione né test. Inizia esaminando la strumentazione IITM/RITM esistente e il pattern TracingChannel di undici; una proposta concreta deve definire i nomi dei canali, le strutture dei payload e la compatibilità con le versioni di Node prima che l'implementazione possa essere considerata completata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I'd like to propose adding first-class TracingChannel support to pg and pg-pool, following the pattern established by undici in Node.js core.
TracingChannel is a higher-level API built on top of diagnostics_channel, specifically designed for tracing async operations. It provides structured lifecycle channels (start, end, error, asyncStart, asyncEnd) and handles async context propagation correctly, which was the missing piece that makes existing monkey-patching approaches fragile in real-world async Node.js applications.
Current instrumentation's today use IITM (import-in-the-middle) for ESM and RITM for CJS which has a few fragility concerns in today's ecosystem state, a few issues we have today:
- Runtime lock-in: both RITM and IITM rely on Node.js-specific module loader internals (
Module._resolveFilename,module.register()). They don't work on Bun or Deno, which implement the Node.js API surface but not the module loader internals. - ESM fragility: IITM is built on Node.js's module customization hooks, which are still evolving and have been a persistent source of breakage in the OTEL JS ecosystem.
- Initialization ordering: both require instrumentation to be set up before
pgis first require()'d. Get the order wrong and instrumentation silently does nothing, which is very hard to debug in production. - Bundling and Externalization: Users have to ensure their instrumented modules are externalized, which is becoming very difficult to guarantee with more and more frameworks bundling the server-side code into single executables, binaries or deployment files.
If pg emits structured events through TracingChannel, instrumentation libraries become subscribers, not patches. Each tool listens independently with no ordering concern, no clobbering, and no internal API dependency.
Before putting together a concrete proposal and PR, wanted to check: is there appetite for this? Happy to spec out channel names, payload shapes, and Node version compatibility considerations if so.
- Lingua principale
- JavaScript
- Stelle
- 13.2k
- Fork
- 1.4k
- Merge medio
- 6g 15h
- PR unite (30g)
- 6
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 brianc/node-postgres
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
brianc/node-postgres#3770 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
brianc/node-postgres#3716 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
brianc/node-postgres#3631 · 1 commento ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 62/100
brianc/node-postgres#2857 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
brianc/node-postgres#2433 ·
Tutte le issue di brianc/node-postgres
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100
-
Issue-Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
sugarlabs/musicblocks#8924 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Apertacustomer-eng status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100