feat(preprod): add read/write helpers for EAP data#104810
Conversation
src/sentry/preprod/eap/read.py
Outdated
| end_timestamp = Timestamp() | ||
| end_timestamp.FromDatetime(end) | ||
|
|
||
| columns = [ |
There was a problem hiding this comment.
For now it's requesting all columns but we can make this configurable as a param too.
src/sentry/preprod/eap/read.py
Outdated
| query_filter = None | ||
| filter_list = _build_filters(filters) if filters else [] | ||
| if filter_list: | ||
| query_filter = TraceItemFilter(and_filter=AndFilter(filters=filter_list)) |
There was a problem hiding this comment.
Right now these filters are all AND'd together but seems like there is flexibility here too.
There was a problem hiding this comment.
yup, you can OR, AND and NOT filters together
| raise ValueError(f"Unsupported EAP value type for AnyValue: {type(value)}") | ||
|
|
||
|
|
||
| def create_attribute_value(attr_type: AttributeKey.Type.ValueType, value: Any) -> AttributeValue: |
There was a problem hiding this comment.
Would love to delete this if there's a better way.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #104810 +/- ##
===========================================
+ Coverage 80.51% 80.57% +0.05%
===========================================
Files 9329 9349 +20
Lines 400842 402468 +1626
Branches 25705 25705
===========================================
+ Hits 322756 324272 +1516
- Misses 77620 77730 +110
Partials 466 466 |
| found = False | ||
|
|
||
| for attempt in range(max_attempts): | ||
| time.sleep(0.5) |
There was a problem hiding this comment.
Sad times, but if there is no way to know when it's done I guess it's unavoidable.
There was a problem hiding this comment.
Yea unfortunately this has to resolve through Kafka/Clickhouse. Will monitor to see if it becomes flaky or not.
chromy
left a comment
There was a problem hiding this comment.
lgtm % some small comments
This allows us to read/write EAP data for our
TraceItemType.TRACE_ITEM_TYPE_PREPROD. I'll wire up the calling spot for these functions in a stacked pull request. Left inline comments for the important parts.