You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Option to ignore specific Postgres (pg) spans #16536
Extracted from #16505 (comment), we should find a way to ignore certain spans emitted from the OTel pg instrumentation. For example, the pg-pool.connect spans.
Solution Brainstorm
Right now, I don't think there is a way to achieve this, given that the pg instrumentation from OTel used in our postgresIntegration doesn't expose an option for (not) starting connect spans. Which means we'll likely need to contribute this upstream or vendor-in the pg instrumentation (with pg already being Otel v2 compatible, we'd likely need to vendor-in anyway).
@Lms24 I have a clarification question on this. A customer raised the problem that they're attempting to use ignoreSpans in their express app on pg-pool.connect spans, using this syntax:
ignoreSpans: [
/pg-pool\.connect/,
]
(SDK version: sentry.javascript.node 9.13.0)
I'd expect these spans to be ignored, but the customer is seeing them still:
Is the reason they're still showing up related to the fact that these are auto-instrumented by the OTel pg instrumentation?
ignoreSpans was introduced in 10.2.0. I recommend upgrading and trying again. I opened getsentry/sentry-docs#14971 to clarify the required version in docs.
OTel added an option to ignore connect spans in the instrumentation. I opened #19291 to expose this option in our integration. So now users can either use ignoreSpans as previously, or configure span ignoring on integration level.
Activity
Lms24 commentedon Jun 10, 2025
This was already requested in open-telemetry/opentelemetry-js-contrib#2017 and we might be able to use the workaround: open-telemetry/opentelemetry-js-contrib#2017 (comment)
cstavitsky commentedon Sep 17, 2025
@Lms24 I have a clarification question on this. A customer raised the problem that they're attempting to use
ignoreSpansin their express app on pg-pool.connect spans, using this syntax:(SDK version:
sentry.javascript.node 9.13.0)I'd expect these spans to be ignored, but the customer is seeing them still:
Is the reason they're still showing up related to the fact that these are auto-instrumented by the OTel
pginstrumentation?Lms24 commentedon Sep 18, 2025
ignoreSpanswas introduced in10.2.0. I recommend upgrading and trying again. I opened getsentry/sentry-docs#14971 to clarify the required version in docs.ignoreConnectSpansoption topostgresIntegration#19292 as a duplicate of this issueLms24 commentedon Feb 11, 2026
OTel added an option to ignore connect spans in the instrumentation. I opened #19291 to expose this option in our integration. So now users can either use
ignoreSpansas previously, or configure span ignoring on integration level.github-actions commentedon Feb 24, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #19291, which was included in the 10.40.0 release.