Skip to content

Feat: Dynamic sampling#1004

Merged
marandaneto merged 27 commits into
mainfrom
feat/dynamic-sampling
Sep 22, 2022
Merged

Feat: Dynamic sampling#1004
marandaneto merged 27 commits into
mainfrom
feat/dynamic-sampling

Conversation

@marandaneto

@marandaneto marandaneto commented Sep 13, 2022

Copy link
Copy Markdown
Contributor

@codecov-commenter

codecov-commenter commented Sep 13, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.97590% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.91%. Comparing base (330bd1a) to head (6c8fac4).
⚠️ Report is 1629 commits behind head on main.

Files with missing lines Patch % Lines
dart/lib/src/sentry_baggage.dart 90.90% 6 Missing ⚠️
dart/lib/src/protocol/sentry_transaction_info.dart 70.00% 3 Missing ⚠️
dart/lib/src/noop_sentry_span.dart 33.33% 2 Missing ⚠️
dart/lib/src/hub_adapter.dart 0.00% 1 Missing ⚠️
...b/src/protocol/sentry_transaction_name_source.dart 85.71% 1 Missing ⚠️
dart/lib/src/sentry_traces_sampler.dart 87.50% 1 Missing ⚠️
dart/lib/src/sentry_transaction_context.dart 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1004      +/-   ##
==========================================
+ Coverage   89.66%   89.91%   +0.24%     
==========================================
  Files         106      113       +7     
  Lines        3329     3539     +210     
==========================================
+ Hits         2985     3182     +197     
- Misses        344      357      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread dart/lib/src/utils/tracing_utils.dart
Comment thread dart/lib/src/utils/tracing_utils.dart Outdated
Comment thread flutter/example/lib/main.dart Outdated
Comment thread dart/lib/src/sentry_baggage.dart Outdated
Comment thread dart/lib/src/sentry_tracer.dart Outdated
Comment thread dart/lib/src/utils/tracing_utils.dart Outdated
Comment thread dart/pubspec.yaml Outdated
meta: ^1.3.0
stack_trace: ^1.10.0
uuid: ^3.0.0
intl: ^0.17.0 # TODO remove or vendor it (its a dart.dev lib)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See https://github.com/getsentry/sentry-dart/pull/1004/files#r974958847
We can either vendor this class or accept it, its a lib maintained by the Dart team, 19 months no new releases

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since these decisions can be more 'platform' specific, I'll defer this to you and community. We've had a few dependencies so far without issues.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this a dependency most users would add anyways? If so I'd say it's fine to add if we expect to need more stuff from it. If it's just the number formatting for APIs maybe we should replace it with custom code instead? Basically we just need to convert the double to a string that doesn't use exponent notation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since it's not part of the standard lib, I'd say so, it's an official lib btw.
Dart does code stripping so bundle size is also not a concern.
The class that does it is quite big and complex, and obviously handles more cases.
https://stackoverflow.com/questions/62989638/convert-long-double-to-string-without-scientific-notation-dart
I'd rather use the lib then so it works on every platform without no surprises, including JS.

@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
platform :ios, '11.0'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because of the new Xcode, it does it automatically, but its just the sample.

@brustolin

Copy link
Copy Markdown
Contributor

Everything looks good. Just need to check why CI is not happy.

@adinauer adinauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left some comments and questions.

Comment thread dart/lib/src/utils/tracing_utils.dart Outdated
Comment thread dart/pubspec.yaml Outdated
meta: ^1.3.0
stack_trace: ^1.10.0
uuid: ^3.0.0
intl: ^0.17.0 # TODO remove or vendor it (its a dart.dev lib)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this a dependency most users would add anyways? If so I'd say it's fine to add if we expect to need more stuff from it. If it's just the number formatting for APIs maybe we should replace it with custom code instead? Basically we just need to convert the double to a string that doesn't use exponent notation.

Comment thread dart/test/utils/tracing_utils_test.dart
Comment thread dart/lib/src/utils/tracing_utils.dart
Comment thread dart/lib/src/utils/tracing_utils.dart
Comment thread dart/lib/src/utils/tracing_utils.dart Outdated
Comment thread dart/lib/src/utils/tracing_utils.dart Outdated
for (final keyValueString in keyValueStrings) {
// TODO: Note, value MAY contain any number of the equal sign (=) characters.
// Parsers MUST NOT assume that the equal sign is only used to separate key and value.
final keyAndValue = keyValueString.split('=');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Java SDK now looks for the first = and splits there instead of splitting on every =. I think this was discussed internally to not have to be changed immediately tho.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, not for now, no SDK handles that so far, so it's a separate issue/TODO.

@marandaneto
marandaneto marked this pull request as ready for review September 20, 2022 12:50
@marandaneto

Copy link
Copy Markdown
Contributor Author

Ignore sentry-flutter / package-analysis (pull_request), this is intended, its a bug in the analyzer.

@brustolin brustolin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions

github-actions Bot commented Sep 21, 2022

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 6c8fac4

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.

6 participants