feat: pg orchestrion instrumentation#21826
Conversation
Add orchestrion instrumentation for Node, Deno, and Bun, covering the `pg` module. This basically copies exactly what the `mysql` integration does, but for postgres. fix: #20764 fix: JS-2415
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 ab619f7. Configure here.
|
🚲 🏠 API surface choice: In order to opt into orchestrion diagnostics-channel-injection style instrumentations, which swap out the vendored OTel instrumentations, we call This initializes the orchestrion integrations, and uses them instead of the OTel ones. However, this means that the only time that the orchestrion integrations are set up and provided with options, is at that moment of calling Sentry.experimentalUseDiagnosticsChannelInjection({ postgres: { ignoreConnectSpans: true } });I don't love this! It exposes the implementation detail in a way that we will likely regret. I kind of hate it, actually.
It was a simple duct-tape way forward, but it sucks. Another approach would be, instead of actually initializing these integrations at that moment to swap in for the OTel ones, just mark that we're going to use the orchestrion ones when we do initialize, and then when it comes time to initialize them, choose which implementation to use, with the configurations provided. I'm going to try spiking that out here. EDIT: yeah, fixed it. Much nicer. The |
This resolves the API surface wart where options for orchestrion integrations had to be passed into the `experimentalUseDiagnosticsChannelInjection` method, and returns that to being an argument-free void-returning opt-in that can be easily no-op'ed in the future, and all options are passed in via `Sentry.init()` as they were in the prior OTel implementation.
fbbe3ae to
334614a
Compare
size-limit report 📦
|

Add orchestrion instrumentation for Node, Deno, and Bun, covering the
pgmodule.This basically copies exactly what the
mysqlintegration does, but for postgres.fix: #20764
fix: JS-2415