-
Notifications
You must be signed in to change notification settings - Fork 779
add commenter_options in trace_integration #3743
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
base: main
Are you sure you want to change the base?
add commenter_options in trace_integration #3743
Conversation
instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py
Show resolved
Hide resolved
Hi @chloe-zh97 thanks for this. A few more requests:
|
0fcd925
to
edb34e6
Compare
Thanks, done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! The Maintainers will also have a look at this PR.
Okay, thank you! |
CHANGELOG.md
Outdated
([#3734](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3734)) | ||
- `opentelemetry-instrumentation`: botocore: upgrade moto package from 5.0.9 to 5.1.11 | ||
([#3736](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3736)) | ||
- `opentelemetry-instrumentation-dbapi`: Add support for `commenter_options` in `trace_integration` to control SQLCommenter behavior |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be moved to unreleased
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.
capture_parameters: bool = False, | ||
enable_commenter: bool = False, | ||
db_api_integration_factory: type[DatabaseApiIntegration] | None = None, | ||
commenter_options: dict[str, Any] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this has a default I would move it as last element so that previous callers using args would still be fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.
eb3f469
to
b232b9a
Compare
Hi @xrmx, could you help review again, many thanks! |
Description
This PR adds support for passing
commenter_options
to thetrace_integration
function andDatabaseApiIntegration
in theopentelemetry-instrumentation-dbapi
package. This allows users to customize SQLCommenter behavior (for example, disablingopentelemetry_values
) when instrumenting DB-API drivers.Fixes #3726
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
test_commenter_options_propagation
andtest_trace_integration_passes_commenter_options
tox -e lint
andpytest
.tox -e ruff
for code formattingDoes This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.