Skip to content
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 sample_rand / fix sample_rate in baggage #4751

Merged
merged 18 commits into from
Jan 31, 2025

Conversation

philprime
Copy link
Contributor

@philprime philprime commented Jan 24, 2025

📜 Description

  • Add sample_rand to the baggage
  • Fixed sample_rate not added to baggage
  • Add additional initializer tests for public interfaces

💡 Motivation and Context

See #4687

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • Perform integrations tests

Copy link

github-actions bot commented Jan 24, 2025

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

Generated by 🚫 dangerJS against 5e98ccf

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 99.53024% with 8 lines in your changes missing coverage. Please review.

Project coverage is 91.390%. Comparing base (70c49ca) to head (5e98ccf).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Sources/Sentry/Profiling/SentryLaunchProfiling.m 73.913% 6 Missing ⚠️
Sources/Sentry/SentrySampling.m 84.615% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4751       +/-   ##
=============================================
+ Coverage   91.101%   91.390%   +0.288%     
=============================================
  Files          626       627        +1     
  Lines        72769     74419     +1650     
  Branches     25866     26755      +889     
=============================================
+ Hits         66294     68012     +1718     
+ Misses        6382      6310       -72     
- Partials        93        97        +4     
Files with missing lines Coverage Δ
Sources/Sentry/SentryBaggage.m 100.000% <100.000%> (ø)
Sources/Sentry/SentryBuildAppStartSpans.m 100.000% <ø> (ø)
Sources/Sentry/SentryHub.m 97.981% <100.000%> (+0.018%) ⬆️
Sources/Sentry/SentrySamplerDecision.m 100.000% <100.000%> (ø)
Sources/Sentry/SentryTraceContext.m 96.644% <100.000%> (+2.289%) ⬆️
Sources/Sentry/SentryTransactionContext.mm 100.000% <100.000%> (ø)
...yProfilerTests/SentryAppLaunchProfilingTests.swift 100.000% <100.000%> (ø)
...SentryProfilerTests/SentryProfileTestFixture.swift 99.704% <100.000%> (+<0.001%) ⬆️
...ts/SentryTests/Helper/SentryFileManagerTests.swift 96.275% <100.000%> (+0.155%) ⬆️
.../SentryTests/Helper/SentrySerializationTests.swift 99.807% <100.000%> (+0.010%) ⬆️
... and 9 more

... and 24 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

Copy link

github-actions bot commented Jan 24, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.77 ms 1248.69 ms 22.92 ms
Size 22.31 KiB 780.61 KiB 758.29 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
eea25a8 1240.54 ms 1262.69 ms 22.15 ms
ed64658 1225.06 ms 1247.73 ms 22.67 ms
2d2068d 1238.02 ms 1249.90 ms 11.88 ms
489fbb8 1238.67 ms 1265.66 ms 26.99 ms
4977fbc 1231.55 ms 1239.80 ms 8.25 ms
9ce54cc 1217.79 ms 1239.42 ms 21.63 ms
ce54c6a 1237.02 ms 1241.02 ms 4.00 ms
522f8da 1230.19 ms 1252.31 ms 22.12 ms
f8833c4 1230.00 ms 1245.27 ms 15.27 ms
a90f228 1226.37 ms 1248.63 ms 22.27 ms

App size

Revision Plain With Sentry Diff
eea25a8 22.31 KiB 771.26 KiB 748.94 KiB
ed64658 22.30 KiB 749.84 KiB 727.54 KiB
2d2068d 21.58 KiB 729.47 KiB 707.89 KiB
489fbb8 21.90 KiB 730.10 KiB 708.20 KiB
4977fbc 20.76 KiB 419.86 KiB 399.10 KiB
9ce54cc 21.58 KiB 573.72 KiB 552.13 KiB
ce54c6a 21.58 KiB 418.60 KiB 397.02 KiB
522f8da 21.90 KiB 726.18 KiB 704.28 KiB
f8833c4 21.58 KiB 422.66 KiB 401.08 KiB
a90f228 21.90 KiB 724.12 KiB 702.22 KiB

Previous results on branch: philprime/issue-4687-sampling-seed-propagation

Startup times

Revision Plain With Sentry Diff
ab1ebcb 1214.52 ms 1235.14 ms 20.62 ms
f5ee173 1225.88 ms 1240.40 ms 14.52 ms
5400890 1230.16 ms 1243.23 ms 13.07 ms
544ce99 1216.27 ms 1227.33 ms 11.06 ms
a618a92 1221.79 ms 1242.41 ms 20.62 ms
abfb8ff 1226.31 ms 1245.65 ms 19.35 ms
63bb06c 1216.49 ms 1237.31 ms 20.82 ms
ca8ee23 1227.45 ms 1247.34 ms 19.89 ms

App size

Revision Plain With Sentry Diff
ab1ebcb 22.31 KiB 777.76 KiB 755.45 KiB
f5ee173 22.31 KiB 780.37 KiB 758.05 KiB
5400890 22.31 KiB 776.94 KiB 754.62 KiB
544ce99 22.31 KiB 777.60 KiB 755.29 KiB
a618a92 22.31 KiB 777.65 KiB 755.34 KiB
abfb8ff 22.31 KiB 776.94 KiB 754.62 KiB
63bb06c 22.31 KiB 777.76 KiB 755.45 KiB
ca8ee23 22.31 KiB 775.60 KiB 753.29 KiB

@philprime philprime force-pushed the philprime/issue-4687-sampling-seed-propagation branch from a0f0b4f to 07f9ad4 Compare January 27, 2025 13:41
@philprime philprime force-pushed the philprime/issue-4687-sampling-seed-propagation branch from 07f9ad4 to 541c625 Compare January 27, 2025 16:40
@philprime philprime changed the title feat: add sample_rand to trace context feat: add sample_rand / fix sample_rate in baggage Jan 28, 2025
@philprime philprime marked this pull request as ready for review January 28, 2025 09:37
@philprime philprime marked this pull request as draft January 28, 2025 09:45
@philprime
Copy link
Contributor Author

Back to draft because I noticed missing test cases

@philprime philprime marked this pull request as ready for review January 28, 2025 11:47
@philprime philprime self-assigned this Jan 28, 2025
Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

I do have one comment that I think would short this PR a lot.

Sources/Sentry/Public/SentrySpanProtocol.h Outdated Show resolved Hide resolved
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.

I will give this a full review once we remove the span changes, as this will significantly reduce the scope of the PR.

Makefile Show resolved Hide resolved
Sources/Sentry/Public/SentryBaggage.h Show resolved Hide resolved
Sources/Sentry/Public/SentrySpanProtocol.h Outdated Show resolved Hide resolved
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.

LGTM, thanks for all the extra tests

Sources/Sentry/SentrySampling.m Outdated Show resolved Hide resolved
Sources/Sentry/Public/SentryTraceContext.h Show resolved Hide resolved
Tests/SentryTests/Protocol/SentryEnvelopeTests.swift Outdated Show resolved Hide resolved
Tests/SentryTests/SentryHubTests.swift Outdated Show resolved Hide resolved
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.

LGTM thanks.

@philprime philprime merged commit 675ef9c into main Jan 31, 2025
71 checks passed
@philprime philprime deleted the philprime/issue-4687-sampling-seed-propagation branch January 31, 2025 10:33
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.

4 participants