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

Strip leading comments from SQL queries when generating the span name. #1434

Merged
merged 4 commits into from
Nov 18, 2022

Conversation

rogersd
Copy link
Contributor

@rogersd rogersd commented Nov 9, 2022

Description

Currently an SQL statement that begins with a comment, such as

/* Get foo from bar */ SELECT foo FROM bar

Will have span.name set to /*, which makes it harder to tell what's going on in the waterfall view for a request.

Instead, this removes the leading comment so that the operation type is used instead.

Fixes #1433

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested?

  • Added additional unit tests.
  • Tested against my company's code.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

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

@rogersd rogersd requested a review from a team as a code owner November 9, 2022 21:50
@rogersd rogersd force-pushed the drogers-strip-comments branch 2 times, most recently from ffc972a to aab3faa Compare November 10, 2022 16:02
@srikanthccv
Copy link
Member

We also have similar logic in a few other places and need to update them too. If you don't want to address it in this PR, Please update the description from Fixes #XX -> Part of #XX.

@rogersd
Copy link
Contributor Author

rogersd commented Nov 10, 2022

I updated it in psycopg2 but I don't see any other places. Let me know if I missed a spot.

@srikanthccv
Copy link
Member

here and here

@rogersd rogersd force-pushed the drogers-strip-comments branch 5 times, most recently from e1c090f to a663628 Compare November 15, 2022 01:37
@ocelotl ocelotl merged commit be4ceec into open-telemetry:main Nov 18, 2022
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.

Strip leading comments from SQL queries when generating the span name.
3 participants