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

[OpenTelemetry] Can we add the db.query.text attribute to the spans? #2042

Open
Kludex opened this issue Oct 18, 2024 · 8 comments · May be fixed by #2061
Open

[OpenTelemetry] Can we add the db.query.text attribute to the spans? #2042

Kludex opened this issue Oct 18, 2024 · 8 comments · May be fixed by #2061
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@Kludex
Copy link

Kludex commented Oct 18, 2024

Hi there,

I was wondering if it would be possible to add the query itself in the span attributes. The list of official OTel attributes for db are listed here.

I'm happy to implement it, if wanted.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Oct 18, 2024
@williamlac
Copy link

+1

This would be a great addition to help us identify which span is related to which of our queries in a much faster way.

@samuelcolvin
Copy link

This would be great, @chelsea-lin can you let us know if you would accept a PR for this?

@Kludex
Copy link
Author

Kludex commented Nov 13, 2024

Hoi 👋

Friendly ping 🏓 😃

@chelsea-lin
Copy link
Contributor

@Kludex Thank you! It sounds good to me! Please go ahead to start the PR please.

@Kludex Kludex linked a pull request Nov 15, 2024 that will close this issue
@Linchin Linchin added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Nov 20, 2024
@Linchin
Copy link
Contributor

Linchin commented Nov 21, 2024

Thank you @Kludex for the feature request and implementation! I also appreciate people upvoting the FR and letting us know your need :)
Indeed it would be very useful to have the query tracked in OpenTelemetry, but saving and sending query text may pose concerns about security and user privacy. I will look deeper into Google Cloud SDK's guidelines about PII data, and see what precautions or actions we need to take to ensure user privacy is protected.

@Kludex
Copy link
Author

Kludex commented Nov 21, 2024

It can be an opt-in feature as well, if you reach the conclusion is necessary to be.

@samuelcolvin
Copy link

@Linchin including the SQL in otel is absolutely necessary, every other db integration includes the SQL.

If you're really saying "we're not going to include the query", you're basically saying "we refuse to support otel with bigquery".

@Linchin
Copy link
Contributor

Linchin commented Nov 21, 2024

If we were to go through privacy review for query text anyway, are there any other things folks would like to track too? Suggestions are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants