-
-
Notifications
You must be signed in to change notification settings - Fork 494
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: Add client reports #1604
feat: Add client reports #1604
Conversation
Transport should only care about sending the event object to the right destination with right format. It doesn't need to check if it's allowed to send an event, which should already be done by `Client#capture_event`.
* add `data_category` to closer match upstream definitions and use it in rate limit as well * record `:ratelimit_backoff` dropped events in `discarded_events`
…nto 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.
Generally looks good. Just some suggestions on styling and testing 👍
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.
Didn't review the PR in-depth but overall looks good to me. I only have one question: we can read the following in the docs
[...] to periodically flush them out as separate envelope item or attach it to an already scheduled envelope.
If no envelope is sent for a long time (say, 5 minutes), does the SDK wait for the next envelope to add the client reports, or reports them before that (in an envelope with potentially only client reports)?
@sl0thentr0py do you think this can go out this week? |
hmm I can finish making the changes and testing by tomorrow I think, so unless I find some problems, I'd say yes? |
@sl0thentr0py awesome. I'm thinking about releasing version |
@iker-barriocanal long answer: What the other 2 sdks do:
However, this 60 second scheduling is itself done only in Another difference: python has both For now, considering my current understanding of what we need client reports for, I think this implementation for ruby is fine. Let me know if you have questions. |
@sl0thentr0py sure, I was just asking the question, LGTM as it is. The only thing I'd add to this conversation is to explicitly mention it somewhere, and IMO the short answer in the PR description should do it (or be more explicit on the third point). |
Codecov Report
@@ Coverage Diff @@
## master #1604 +/- ##
==========================================
+ Coverage 98.43% 98.51% +0.08%
==========================================
Files 130 130
Lines 7223 7285 +62
==========================================
+ Hits 7110 7177 +67
+ Misses 113 108 -5
Continue to review full report at Codecov.
|
@@ -44,6 +44,12 @@ | |||
config.before(:each, rack: true) do | |||
skip("skip rack related tests") unless defined?(Rack) | |||
end | |||
|
|||
RSpec::Matchers.define :have_recorded_lost_event do |reason, type| |
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.
@st0012 not an rspec pro so not sure if this is the right way to do this? let me know :)
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 think it looks good and I've also tested it locally 👍
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.
@st0012 changed the specs and made some minor changes based on various comments above, can you take it for another spin?
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.
Thanks for the amazing feature 👍
@st0012 thank you for helping me with my first PR! |
This PR adds support for Client Reports.
send_client_reports
, true by defaultTransport
store
endpointSome notes: