Fix clickhouse-driver integration spans#3638
Merged
sentrivana merged 10 commits intopotel-basefrom Oct 10, 2024
Merged
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 |
sentrivana
commented
Oct 9, 2024
| _set_db_data(span, connection) | ||
|
|
||
| span.set_data("query", query) | ||
| span.set_data("db.query.text", query) |
Contributor
Author
There was a problem hiding this comment.
sl0thentr0py
requested changes
Oct 9, 2024
| span.scope.add_breadcrumb( | ||
| message=span._data.pop("query"), category="query", data=span._data | ||
| ) | ||
| query = span._get_attribute("db.query.text") |
Member
There was a problem hiding this comment.
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.
sentrivana
commented
Oct 9, 2024
data in clickhouse-driver integration
sl0thentr0py
approved these changes
Oct 10, 2024
This was referenced Oct 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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