-
-
Notifications
You must be signed in to change notification settings - Fork 256
Feat: Client Report Recorder #809
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
Conversation
Codecov Report
@@ Coverage Diff @@
## feat/client-reports #809 +/- ##
=======================================================
- Coverage 89.83% 89.17% -0.67%
=======================================================
Files 114 92 -22
Lines 3670 2918 -752
=======================================================
- Hits 3297 2602 -695
+ Misses 373 316 -57
Continue to review full report at Codecov.
|
final DateTime Function() _dateTimeProvider; | ||
final Map<_QuantityKey, int> _quantities = {}; | ||
|
||
void recordLostEvent(final Outcome reason, final RateLimitCategory category) { |
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 need to double check if RateLimitCategory
is accurate and if it's missing new entries.
See https://github.com/getsentry/develop/pull/535/files and https://github.com/getsentry/develop/pull/536/files
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.
Hmm, hard to say. We are missing the internal
type in RateLimitCategory
, but have the __all__
type, which i think is specific to the rate limiting implementation and should probably never be used here. Should we create a separate enum type to be on the safe side?
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.
Let's wait those 2 PRs get reviewed/merged, we can rename to DataCategory
at least in case this is not a breaking change to public APIs
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.
Yes, I also renamed RateLimitCategory
to DataCategory
on Cocoa as relay uses DataCategory
for both rate limits and client reports.
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.
Can you point me to the appropriate PR/commit? Intrested in how you are handling the "all" case, assuming that it should not be valid in the client report context and is specific to rate limiting.
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.
Just wondering, as the Dart implementation was ported from sentry-java
and we have an all
category there: https://github.com/getsentry/sentry-java/blob/b45944c93d53f68bc1e64f5ac4c9a5400b252d44/sentry/src/main/java/io/sentry/transport/RateLimiter.java#L25
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.
I haven't added any special validation code to prevent usage of DataCategory enum values not meant for client reports as we don't need to take care of this (just asked).
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.
A few minor conceptual comments. Thanks, @denrase for taking care of client reports 🚀
final DateTime Function() _dateTimeProvider; | ||
final Map<_QuantityKey, int> _quantities = {}; | ||
|
||
void recordLostEvent(final Outcome reason, final RateLimitCategory category) { |
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.
Yes, I also renamed RateLimitCategory
to DataCategory
on Cocoa as relay uses DataCategory
for both rate limits and client reports.
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.
LGTM
#skip-changelog
📜 Description
💡 Motivation and Context
This is the first PR for implementing client reports. It's based on the work done in the JS SDK, except that some of the business logic from transport is encapsulated in a separate class.
💚 How did you test it?
Unit tests.
📝 Checklist
🔮 Next steps