Add `diagnostics_channel` support for query and connection lifecycle events
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- javascript, node.js, postgresql
調査の方向性
この issue では pg と pg-pool が挙げられていますが、実装ファイルやテストはありません。まず既存の IITM/RITM インストルメンテーションと undici の TracingChannel パターンを確認してください。具体的な提案では、実装が完了したと見なせるようになる前に、チャンネル名、ペイロードの形式、Node バージョンとの互換性を確定する必要があります。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- JavaScript
- スター
- 13.2k
- フォーク
- 1.4k
- 平均マージ
- 6日 15時間
- マージ済み PR(30日)
- 6
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
brianc/node-postgres のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
brianc/node-postgres#3770 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
brianc/node-postgres#3716 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
brianc/node-postgres#3631 · コメント 1 件 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 62/100
brianc/node-postgres#2857 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
brianc/node-postgres#2433 ·
brianc/node-postgres の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
antfu-collective/icones#398 ·
-
ECmail.com オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
wesbos/burner-email-providers#554 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
components-web-app/docs#92 ·