sql-pg: trace each connection attempt, with why it failed
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start by reading the existing db.connect span behavior in @effect/sql-pg and the PgConnection connection-attempt flow. Check how password resolution, timeout, authentication, interruption, and ReadyForQuery are handled, then compare the proposed span and failure categories with project conventions. Done means the maintainers agree on the API shape and a PR covers per-attempt tracing without changing pool behavior.
索引モデルが issue の本文から書いたものです。
説明
Note: everything below was written by an AI agent working on the author's behalf and may not have been reviewed by a human.
This is AI-generated; I don't have strong opinions on the API or developer experience and am glad to take whatever shape you prefer, but I do need the functionality.
Problem
With SpanPropagationEnabled, @effect/sql-pg adds a db.connect child span to a statement that waited for a new session (#8676), covering the part of the connect it waited for. A connection attempt has no span of its own, so these are invisible in a trace:
- an attempt that fails, and why: a timeout, a refused or unreachable host, an authentication failure, or something else;
- an attempt that no statement waited for, such as one the pool opens ahead of demand;
- how long password resolution, the TCP/TLS connect and authentication took, until
ReadyForQuery.
On serverless Postgres behind a proxy, failed and slow connects are exactly what I need to see when the first query of a request is slow.
What I do today
I carry a patch to PgConnection that wraps each connection attempt in a client span, sql.connect:
- It covers password resolution, the driver's connect and authentication, and
connectTimeout, and ends atReadyForQuery, or on failure or interruption. The timeout runs inside the span, so a timed-out attempt fails its span instead of ending OK. - It records
db.connect.attemptand, on failure,db.connect.failure:timeout,refused(the socket never connected, or the server refused the startup for a reason other than authentication),auth(SQLSTATE class 28, or no password), orother. The category comes from when the attempt failed, not from the socket error's text, because some runtimes give a refused connection no error code. - It records no URL, credentials or query text. An attempt its caller interrupts records no failure.
- Pool behaviour (lazy acquisition, reuse, idle release) is unchanged, and it opens no connection to measure one.
Questions
- Would you take a per-attempt span in
@effect/sql-pg, alongside the existingdb.connect? - Are a span name
sql.connectand the attributesdb.connect.attempt/db.connect.failureacceptable, or would you rather follow another convention?
I can open a PR once the shape is agreed.
- 主要言語
- TypeScript
- スター
- 16.7k
- フォーク
- 808
- 平均マージ
- 21時間 22分
- マージ済み PR(30日)
- 486
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Effect-TS/effect のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing components対応中かも @effect-bot が今日担当しました。 オープン
Effect-TS/effect#11097 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`対応中かも @effect-bot が今日担当しました。 オープン
Effect-TS/effect#11096 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
Effect-TS/effect の issue をすべて見る
似ている issue
-
check:failed streams:edit
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
iptv-org/iptv#60585 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Critical path skips a child span that ends exactly when the next one starts対応中かも @Piyush4801 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jaegertracing/jaeger-ui#4865 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信