refactor(contrib): migrate database integrations to events API #21859
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.68) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.68 · 274 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.336
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.068
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #21859"
general
weight: 0.35
dubloom
Description
Migrate shared sync/async DB-API wrappers, asyncpg connection/query instrumentation, and aiomysql queries to typed database events and the shared tracing lifecycle.
DatabaseOperationEventextendsTracingEvent;DatabaseTracingSubscriberextendsTracingSubscriber.Original query resources, parent relationships, measured flags, security checks, and DBM exclusions for fetches, stored procedures, and prepared statements are preserved.
Customer impact
This updates an unreleased internal refactor. Supported driver operations retain their behavior; span metadata adopts the shared tracing conventions described below.
Testing
scripts/lint checks, and dependency/import-cycle comparisons passed.Risks
A cursor metadata failure can omit row counts or query IDs. It does not change the driver's query result or replace its exception.
Additional Notes
The shared lifecycle adds standard
_dd.svc_srcservice-source attribution and uses the shared component/span-kind tagging order instead of per-driver event flags. The asyncpg snapshots reflect the intended attribution change.The internal
_set_post_execute_tags(span)hook is removed. Result metadata uses_get_post_execute_result(context).