Skip to content

Fix psycopg_pool instrumentation to restore Postgres spans#2460

Open
JaeHyuckSa wants to merge 6 commits into
elastic:mainfrom
JaeHyuckSa:fix/psycopg-pool-instrumentation
Open

Fix psycopg_pool instrumentation to restore Postgres spans#2460
JaeHyuckSa wants to merge 6 commits into
elastic:mainfrom
JaeHyuckSa:fix/psycopg-pool-instrumentation

Conversation

@JaeHyuckSa
Copy link
Copy Markdown

What does this pull request do?

  • instrument psycopg.Connection.connect so that psycopg_pool.ConnectionPool-managed connections are proxied and DB spans are emitted again

Related issues

Closes #2094

@JaeHyuckSa JaeHyuckSa requested a review from a team as a code owner October 17, 2025 18:13
@cla-checker-service
Copy link
Copy Markdown

cla-checker-service Bot commented Oct 17, 2025

💚 CLA has been signed

@github-actions
Copy link
Copy Markdown

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions github-actions Bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Oct 17, 2025
@JaeHyuckSa JaeHyuckSa force-pushed the fix/psycopg-pool-instrumentation branch from 0b6bbdd to a1200b5 Compare October 17, 2025 18:17
Copy link
Copy Markdown
Member

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. We are using - as separator so the test framework name should be called psycopg_pool and reqs and envs file should be renamed. Also in order to run tests in CI you need to add an entry psycopg_pool-newest in .ci/.matrix_framework.yml and .ci/.matrix_framework_full.yml.

@xrmx
Copy link
Copy Markdown
Member

xrmx commented Nov 4, 2025

@JaeHyuckSa The tests file name was good, the requirements and environments one are wrong. Also the matrix files update is missing.

@JaeHyuckSa JaeHyuckSa force-pushed the fix/psycopg-pool-instrumentation branch 2 times, most recently from 4ed3c00 to c30e88b Compare November 5, 2025 15:35
Signed-off-by: SaJH <wogur981208@gmail.com>
@JaeHyuckSa JaeHyuckSa force-pushed the fix/psycopg-pool-instrumentation branch from c30e88b to e67babb Compare November 5, 2025 15:38
@JaeHyuckSa
Copy link
Copy Markdown
Author

@xrmx Thank you for the review. I was going to make some other changes back then but forgot about it… I’ve now reflected everything you mentioned!

Copy link
Copy Markdown
Member

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing, PTAL

Comment thread tests/instrumentation/psycopg_pool_tests.py Outdated
Copy link
Copy Markdown
Member

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test matrix

@JaeHyuckSa JaeHyuckSa force-pushed the fix/psycopg-pool-instrumentation branch from b531086 to e60fbeb Compare January 21, 2026 10:13
Signed-off-by: JaeHyuck Sa <wogur981208@gmail.com>
@JaeHyuckSa JaeHyuckSa force-pushed the fix/psycopg-pool-instrumentation branch from e60fbeb to 2421219 Compare January 21, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-python community Issues opened by the community triage Issues awaiting triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

psycopg pool not instrumented

2 participants