Skip to content
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

feat(instrumentation-dbapi): add experimental sql commenter capability #908

Merged
merged 7 commits into from
Feb 11, 2022

Conversation

srikanthccv
Copy link
Member

Description

This PR adds support for an experimental and optional feature for enabling sql commenter capability to dbapi instrumentation.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • tox -e test-instrumentation-dbapi

Does This PR Require a Core Repo Change?

  • No.

@srikanthccv srikanthccv requested a review from a team February 9, 2022 15:32
_KEY_VALUE_DELIMITER = ","


def _generate_sql_comment(**meta):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really necessary to add this to utils? This is a single-use function, its contents can just be used directly where the function is called.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think so, there will be many sql db instrumentations that will rely on this.

@@ -115,3 +116,38 @@ def _start_internal_or_server_span(
attributes=attributes,
)
return span, token


_KEY_VALUE_DELIMITER = ","
Copy link
Contributor

Choose a reason for hiding this comment

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

Single-use constant

srikanthccv and others added 6 commits February 10, 2022 03:24
@srikanthccv srikanthccv requested a review from ocelotl February 11, 2022 05:07
@ocelotl ocelotl merged commit d54b61e into open-telemetry:main Feb 11, 2022
@srikanthccv srikanthccv deleted the dbapi-comment-feat branch February 11, 2022 16:17
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.

2 participants