-
Notifications
You must be signed in to change notification settings - Fork 518
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
Fix clickhouse-driver integration spans #3638
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 |
@@ -91,7 +91,7 @@ def _inner(*args: P.args, **kwargs: P.kwargs) -> T: | |||
|
|||
_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_attribute
to publicPOTelSpan.get_attribute
clickhouse-driver integration
set_data
toset_attribute
db.params
is now a stringparams
are 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.text
has been added. Previously, we were storingquery
on 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.name
and indb.query.text
.)same_process_as_parent
in the tests, now we're not.status
attribute, we're also not checking this in the tests.Caveats
subprocess
breadcrumbs frommaybe_create_breadcrumbs_from_span
to integration. #3637