fix(instrumentation-pg): derive pool name from connectionString #3870
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.38) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.38 · 111 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.282
Real PR Conversation Timeline
1 comments
"Review active on #3870"
general
weight: 0.35
helmipradita
Which problem is this PR solving?
Fixes #3868
When a PostgreSQL pool is initialized with a
connectionString(common with ORMs like Drizzle and Prisma) rather than discretehost/port/databaseoptions,getPoolName(pool)returnsunknown_host:unknown_port/unknown_database. This causes all connection pool metrics across multiple connection strings to coalesce into a single pool name.Short description of the changes
getPoolName()inpackages/instrumentation-pg/src/utils.tsto parseconnectionStringwhen present usingnew URL(connectionString).connectionStringtake precedence, then falls back to discretehost/port/databasefields, and finally tounknown_*defaults.packages/instrumentation-pg/test/utils.test.tsverifyinggetPoolName()with aconnectionString.