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

set db.query.text OpenTelemetry attribute #2061

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Kludex
Copy link

@Kludex Kludex commented Nov 15, 2024

@Kludex Kludex requested review from a team as code owners November 15, 2024 10:11
Copy link

google-cla bot commented Nov 15, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Nov 15, 2024
@@ -42,7 +42,6 @@
TEST_SPAN_ATTRIBUTES = {"foo": "baz"}


@pytest.mark.skipif(opentelemetry is None, reason="Require `opentelemetry`")
Copy link
Author

Choose a reason for hiding this comment

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

It's not possible to add marks to fixtures, this was wrong.

Comment on lines +162 to +164
query = getattr(job_ref, "query", None)
if query is not None:
job_attributes["db.query.text"] = query
Copy link
Author

Choose a reason for hiding this comment

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

"query" is only available when the job is a QueryJob.

@Kludex
Copy link
Author

Kludex commented Nov 15, 2024

I've signed CLA.

@Linchin Linchin assigned Linchin and unassigned obada-ab Nov 20, 2024
@Linchin Linchin added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 21, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 21, 2024
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. and removed size: s Pull request size is small. labels Nov 21, 2024
@Kludex Kludex changed the title Set db.query.text OpenTelemetry attribute set db.query.text OpenTelemetry attribute Nov 21, 2024
@Linchin Linchin added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 22, 2024
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. do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OpenTelemetry] Can we add the db.query.text attribute to the spans?
4 participants