Skip to content

missing capture_parameters in instrumentation psycopg #3676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

StefanoOvus
Copy link

@StefanoOvus StefanoOvus commented Aug 5, 2025

Description

Added missing parameter capture_parameters for psycopg instrumentation:

PsycopgInstrumentor().instrument(capture_parameters=True)

populates the db.statement.parameters attribute in spans.

Fixes #3569

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Added tests for sync and async connection:

  • instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py::TestPostgresqlIntegration::test_span_params_attribute
  • instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py::TestPostgresqlIntegrationAsync::test_span_params_attribute

Tested in a small script with Python 3.13.3 + jaegertracing/jaeger:2.6.0 docker image (OTLP/gRPC protocol).

  • tox -e py313-test-instrumentation-psycopg
  • tox -e spellcheck
  • tox -e lint-instrumentation-psycopg

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Copy link

linux-foundation-easycla bot commented Aug 5, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PsycopgInstrumentor capture_parameters
1 participant