feat(asyncpg): add capture_connection_cleanup option to silence pool cleanup spans#4373
feat(asyncpg): add capture_connection_cleanup option to silence pool cleanup spans#4373RiyaChaturvedi37 wants to merge 18 commits into
Conversation
…cleanup spans Closes open-telemetry#4264
5547d9b to
73f9258
Compare
|
Thank you for this @RiyaChaturvedi37 ! I have added some comments |
|
Note: The large diff (+2440/-2389) is due to Windows line ending (CRLF) differences in the existing file on my local machine. The actual code changes are minimal — only 3 files with the new feature, tests, and changelog entry. I apologize for the noise! |
tammy-baylis-swi
left a comment
There was a problem hiding this comment.
Thank you for fixes, lgtm! Just suggested a small docs update. The Maintainers will also have to review this.
Done! Added the clarifying comment as suggested. |
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
|
Still actively working on this! Will resolve the CHANGELOG conflict shortly. |
|
Still actively working on this! Just resolved the CHANGELOG conflict and all checks are passing. Also updated the implementation based on @xrmx's feedback — replaced AsyncPGInstrumentor(exclude_queries=AsyncPGInstrumentor._CLEANUP_QUERIES).instrument()This allows users to exclude any custom set of queries, not just the cleanup ones. |
|
Thanks for the PR! Just a heads-up: we no longer update Please add the appropriate changelog fragment for this change instead of editing |
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
Closes #4264
Description
Adds a new
exclude_queriesoption toAsyncPGInstrumentorto allowsilencing specific queries from being traced.
When using a connection pool, asyncpg executes cleanup statements after
each invocation:
These can pollute traces. Users can now exclude them:
The option accepts any set of queries, making it flexible for other use cases too.
Type of change