Skip to content

feat(preprod): add read/write helpers for EAP data#104810

Merged
trevor-e merged 37 commits intomasterfrom
telkins/eap
Dec 15, 2025
Merged

feat(preprod): add read/write helpers for EAP data#104810
trevor-e merged 37 commits intomasterfrom
telkins/eap

Conversation

@trevor-e
Copy link
Copy Markdown
Member

@trevor-e trevor-e commented Dec 11, 2025

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.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 11, 2025
end_timestamp = Timestamp()
end_timestamp.FromDatetime(end)

columns = [
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For now it's requesting all columns but we can make this configurable as a param too.

query_filter = None
filter_list = _build_filters(filters) if filters else []
if filter_list:
query_filter = TraceItemFilter(and_filter=AndFilter(filters=filter_list))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right now these filters are all AND'd together but seems like there is flexibility here too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yup, you can OR, AND and NOT filters together

trevor-e and others added 2 commits December 11, 2025 16:12
# Conflicts:
#	src/sentry/search/eap/rpc_utils.py
raise ValueError(f"Unsupported EAP value type for AnyValue: {type(value)}")


def create_attribute_value(attr_type: AttributeKey.Type.ValueType, value: Any) -> AttributeValue:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Would love to delete this if there's a better way.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 83.16832% with 17 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/search/eap/rpc_utils.py 48.27% 15 Missing ⚠️
src/sentry/preprod/eap/read.py 94.59% 2 Missing ⚠️
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              

@trevor-e trevor-e requested review from a team as code owners December 12, 2025 16:48
found = False

for attempt in range(max_attempts):
time.sleep(0.5)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sad times, but if there is no way to know when it's done I guess it's unavoidable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yea unfortunately this has to resolve through Kafka/Clickhouse. Will monitor to see if it becomes flaky or not.

Copy link
Copy Markdown
Contributor

@chromy chromy left a comment

Choose a reason for hiding this comment

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

lgtm % some small comments

Comment on lines +143 to +148
ResolvedAttribute(
public_alias="timestamp",
internal_name="sentry.timestamp",
internal_type=constants.DOUBLE,
search_type="string",
),

This comment was marked as outdated.

@trevor-e trevor-e merged commit 9edc93f into master Dec 15, 2025
69 checks passed
@trevor-e trevor-e deleted the telkins/eap branch December 15, 2025 23:58
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants