-
Notifications
You must be signed in to change notification settings - Fork 568
Fix clickhouse-driver integration spans #3638
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
Conversation
❌ 2933 Tests Failed:
View the top 3 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
| _set_db_data(span, connection) | ||
|
|
||
| span.set_data("query", query) | ||
| span.set_data("db.query.text", query) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| span.scope.add_breadcrumb( | ||
| message=span._data.pop("query"), category="query", data=span._data | ||
| ) | ||
| query = span._get_attribute("db.query.text") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need to access attributes outside, let's officially expose get_attributes or a @property called attributes. Accessing underscore methods outside the implementation is an anti-pattern and we should stop doing that.
data in clickhouse-driver integration
General
POTelSpan._get_attributeto publicPOTelSpan.get_attributeclickhouse-driver integration
set_datatoset_attributedb.paramsis now a stringparamsare now stored on the connection temporarily. Previously, they were saved on the span, but since we're setting them once and then reading them and appending to them in another place, span attrs no longer work for this nicely -- we'd need to serialize them to str, then deserialize to add stuff, and serialize again. So I'm changing this to keep track of them elsewhere to avoid this dance.db.query.texthas been added. Previously, we were storingqueryon the span temporarily, but then were getting rid of it. This PR preserves it and gives it an OTel-friendly name. (This also means the query text is now stored on the span 3x -- in the description, insentry.nameand indb.query.text.)same_process_as_parentin the tests, now we're not.statusattribute, we're also not checking this in the tests.Caveats
subprocessbreadcrumbs frommaybe_create_breadcrumbs_from_spanto integration. #3637