-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(analytics): add first_attempt
as a filter for PaymentFilters
#6604
base: main
Are you sure you want to change the base?
Conversation
Changed Files
|
first_attempt
as a filter for PaymentFilters
@@ -104,6 +104,11 @@ where | |||
.add_filter_in_range_clause(PaymentDimensions::ErrorReason, &self.error_reason) | |||
.attach_printable("Error adding error reason filter")?; | |||
} | |||
if !self.first_attempt.is_empty() { | |||
builder | |||
.add_filter_in_range_clause("first_attempt", &self.first_attempt) |
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 aren't we using a PaymentDimensions
enum variant as the first param 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.
This is because, first_attempt
is added only as a filter
in PaymentFilters
and not as a dimension
in PaymentDimensions
. Basically, this field can only be added as a filter
and not as a group_by
.
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 are also planning to segregate these structs based on the type of sources we have , but for now this is needed.
Type of Change
Description
Added
first_attempt
as a filter inPaymentFilters
.This is required for the new Analytics v2
Smart Retries
Metrics, specificallySmart Retries Successful Distribution
andSmart Retries Failure Distribution
, for calculations only involving smart retries (ignoring first attempts).Additional Changes
Motivation and Context
Helps in calculating certain metrics seamlessly.
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy