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

Support sqlcomment-in-db.statement as an opt-in for db driver/ORM instrumentors #3107

Open
6 tasks
tammy-baylis-swi opened this issue Dec 13, 2024 · 0 comments
Open
6 tasks
Assignees

Comments

@tammy-baylis-swi
Copy link
Contributor

tammy-baylis-swi commented Dec 13, 2024

What problem do you want to solve?

Some platforms that use the Python db client component instrumentors don't need db.statement population with sqlcomment -- see this issue comment. Currently this always happens as long as sqlcommenting is enabled, e.g.:

Attributes:
     -> db.system: Str(postgresql)
     -> db.name: Str(world-db)
     -> db.statement: Str(SELECT * FROM city WHERE id = %s /*db_driver='psycopg2%%3A2.9.9',traceparent='00-acbdad825030e4fc58260b2bd9861eb3-451dac2c63520272-01'*/)
     -> db.user: Str(world)
     -> net.peer.name: Str(postgres-world-db)
     -> net.peer.port: Int(5432)

Describe the solution you'd like

Implement support of a config so that Python db client component instrumentors only add sqlcomment to db.statement when opted in. Default should not include the comment.

Changes are required in:

Describe alternatives you've considered

This is a short-term solution. Longer term, we need to start with a general semconv upgrade of the db driver/ORM instrumentors: #2453. Part of this is moving from assignment of db.statement to db.query.text.

Additional Context

Will append to changes made for #2936 and #2938

Would you like to implement a fix?

Yes

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

No branches or pull requests

1 participant