-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: eap support formulas in timeseries endpoint #6854
Conversation
95b2935
to
11f6569
Compare
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
a5490fb
to
0d6eff8
Compare
@@ -107,5 +121,6 @@ def _execute(self, in_msg: TimeSeriesRequest) -> TimeSeriesResponse: | |||
raise BadSnubaRPCRequestException( | |||
"This endpoint requires meta.trace_item_type to be set (are you requesting spans? logs?)" | |||
) | |||
in_msg = _convert_aggregations_to_expressions(in_msg) |
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.
in_msg.aggregations
was deprecated to be replaced with in_msg.expressions
https://github.com/getsentry/sentry-protos/pull/105/files#diff-82c0471037e5c909123fcef5d5283670bf14ee7af2fe80b3fee909143e46f4adR26
this change makes it so any time a user passes aggregations
it get converted to expressions
before hitting the resolver
schema=get_entity(EntityKey("eap_spans")).get_data_model(), | ||
sample=None, | ||
) | ||
def _get_reliability_context_columns( |
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.
existing logic extracted into a new function
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.
all changes to this resolver is just to support the transition from TimeSeriesRequest.aggregations
to TimeSeriesRequest.expressions
@@ -154,7 +167,7 @@ def _convert_result_timeseries( | |||
extrapolation_context = ExtrapolationContext.from_row( | |||
timeseries.label, row_data | |||
) | |||
if extrapolation_context.is_data_present: | |||
if row_data.get(timeseries.label, None) is not None: |
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.
@davidtsuk this line may interest you
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.
why? What's the relevant or interesting change here?
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.
We used to rely on logic inside ExtrapolationContext
to determine if we leave something out of the results.
We now are just relying on whether the data itself has the value None
.
This change can happen now that davids pr to support null values properly is merged
… aggregates field to expression field
…of formula count, look for bug in item table
87f630b
to
b45d1f4
Compare
def _get_reliability_context_columns( | ||
expressions: Iterable[ProtoExpression], | ||
) -> list[SelectedExpression]: | ||
# this reliability logic ignores formulas, meaning formulas may not properly support reliability |
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.
is this a final state of things or is this something that needs to be done later?
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.
The final state until a product team complains about it. I should probably let them know about it.
this PR implements support for formulas in the timeseries endpoint. it closes this ticket https://github.com/getsentry/eap-planning/issues/27
major changes:
TimeSeriesRequest.aggregations
toTimeSeriesRequest.expressions
tests:
design decisions