Repository navigation
fix(db): Align db instrumentations to require a parent span - #25879
nicohrubec wants to merge 7 commits into
Conversation
Co-Authored-By: GPT-6 <codex@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 368dc83. Configure here.
size-limit report 📦Compared: 3981477 (PR test merge using develop at 53daa00) Against: 53daa00 (develop) · base run #64191 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 1 not successful, 56 successful. See the run.
Successful checks
|
Co-Authored-By: GPT-6 <codex@openai.com>
Co-Authored-By: GPT-6 <codex@openai.com>
Co-Authored-By: GPT-6 <codex@openai.com>
Co-Authored-By: GPT-6 <codex@openai.com>
Co-Authored-By: GPT-6 <codex@openai.com>
| const { default: Redis } = await import('ioredis-5'); | ||
| const redisClient = new Redis({ host: '127.0.0.1', port: 6382, lazyConnect: true }); | ||
|
|
||
| await redisClient.connect(); |
There was a problem hiding this comment.
This moved into startSpan so that the connect span gets recorded right?
This seems like an annoying downside... I'd assume most users don't have the connect call inside a span. 🤔
There was a problem hiding this comment.
yes that's the reason. why do you worry about the connect call specifically?
There was a problem hiding this comment.
if this is a special case we can exempt the connect span
There was a problem hiding this comment.
I'd assume most users call connect on app startup and it will probably not have a parent span. I think we need to exempt here.
There was a problem hiding this comment.
yeah sounds reasonable I'll exempt all the connect spans then similar for mysql2 and postgresql
Co-Authored-By: GPT-6 <codex@openai.com>

Why: Unparented DB queries and cache commands lack application context. Use core's
onlyIfParentto align all db instrumentations to only start spans if there is an active parent.How to review: This adds
onlyIfParent: trueto all db instrumentations, replacingrequiresParentSpanwhere necessary. Spans that are emitted at server startup (e.g. redis connect spans) where we can assume that in most cases no parent will be active are exempt from this rule.Closes #25793
Closes #25796
Closes #25798
Closes #25799
Closes #25801
Closes #25802
Closes #25803
Closes #25804
Closes #25805