Skip to content

Feat: Record & Send Client Reports #813

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

Merged
merged 20 commits into from
Apr 13, 2022

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Mar 29, 2022

#skip-changelog

📜 Description

  • Integrate recorder into Transport implementations.

  • Record dropped events & transactions.

    • Rate Limit
    • Sample Rate
    • Before Send
    • Event Processor
  • Exposes void recordLostEvent(DiscardReason reason, DataCategory category) on SentryClient and Hub.

💡 Motivation and Context

Record client reports.

💚 How did you test it?

Unit tests.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

Denis Andrašec added 2 commits March 29, 2022 14:49
…-report

# Conflicts:
#	dart/lib/src/client_reports/client_report_recorder.dart
@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2022

Codecov Report

Merging #813 (04b8f2d) into feat/client-report-envelope-item (647fe2d) will decrease coverage by 2.71%.
The diff coverage is 85.71%.

@@                         Coverage Diff                          @@
##           feat/client-report-envelope-item     #813      +/-   ##
====================================================================
- Coverage                             92.27%   89.55%   -2.72%     
====================================================================
  Files                                    26      102      +76     
  Lines                                   777     3132    +2355     
====================================================================
+ Hits                                    717     2805    +2088     
- Misses                                   60      327     +267     
Impacted Files Coverage Δ
...rc/client_reports/noop_client_report_recorder.dart 0.00% <0.00%> (ø)
dart/lib/src/sentry_options.dart 85.29% <0.00%> (ø)
dart/lib/src/hub.dart 80.48% <100.00%> (ø)
dart/lib/src/sentry_client.dart 94.73% <100.00%> (ø)
dart/lib/src/sentry_envelope.dart 100.00% <100.00%> (ø)
dart/lib/src/transport/rate_limiter.dart 95.34% <100.00%> (ø)
flutter/lib/src/flutter_sentry_attachment.dart
...src/integrations/native_app_start_integration.dart
flutter/lib/src/sentry_native.dart
.../lib/src/navigation/sentry_navigator_observer.dart
... and 105 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 647fe2d...04b8f2d. Read the comment docs.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Nothing to add yet. I'm looking forward to more code 😀

@denrase denrase changed the title Send Client Report Feat: Record & Send Client Reports Apr 6, 2022
@denrase denrase marked this pull request as ready for review April 6, 2022 09:17
@@ -19,19 +22,22 @@ class HttpTransport implements Transport {

final RateLimiter _rateLimiter;

final ClientReportRecorder _clientReportRecorder;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe ClientReportRecorder should be a property of SentryOptions? cc @philipphofmann

Copy link
Member

Choose a reason for hiding this comment

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

We don't put dependencies / objects to the options in ObjC. I guess you should follow your SDKs conventions and you can answer best how to follow these I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't really have a central object/place to init dependencies AFAIK, but we rather worked with singletons for now, or other objects construct their dependencies internally, like in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With the refactoring to not expose the new classes I moved the instance of ClientReportRecorder to options. It is mainly used to access the instance in Hub, SentryClient and tests.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

This looks pretty good 👍 . I maybe found two issues.

@denrase denrase requested a review from philipphofmann April 11, 2022 14:09
@denrase denrase requested a review from marandaneto April 11, 2022 14:09
…-report

# Conflicts:
#	dart/test/client_reports/client_report_test.dart
@denrase denrase merged commit df0c070 into feat/client-report-envelope-item Apr 13, 2022
@denrase denrase deleted the feat/send-client-report branch April 13, 2022 07:28
@denrase denrase mentioned this pull request Apr 13, 2022
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants