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

Fix inheriting sampling decision from parent. #1100

Merged
merged 3 commits into from
Dec 11, 2020
Merged

Fix inheriting sampling decision from parent. #1100

merged 3 commits into from
Dec 11, 2020

Conversation

maciejwalkowiak
Copy link
Contributor

Fixes gh-1099

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Fix inheriting sampling decision from parent.

💡 Motivation and Context

When transaction was created from transaction context without providing custom sampling context, tracingSampler was not used.

💚 How did you test it?

Unit test.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

val transaction = hub.startTransaction(transactionContext)
assertNotNull(transaction)
assertNotNull(transaction.isSampled)
assertTrue(transaction.isSampled!!)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need !! here? Kotlin should do it automatically for you as you did assertNotNull(transaction.isSampled) before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we wouldn't if its immutable. But unfortunately it is mutable.

@codecov-io
Copy link

Codecov Report

Merging #1100 (920d40e) into main (f9f2686) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #1100   +/-   ##
=========================================
  Coverage     73.97%   73.97%           
  Complexity     1576     1576           
=========================================
  Files           163      163           
  Lines          5603     5603           
  Branches        570      570           
=========================================
  Hits           4145     4145           
  Misses         1171     1171           
  Partials        287      287           
Impacted Files Coverage Δ Complexity Δ
sentry/src/main/java/io/sentry/Hub.java 65.32% <100.00%> (ø) 71.00 <1.00> (ø)

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 f9f2686...b63929c. Read the comment docs.

@maciejwalkowiak maciejwalkowiak merged commit de00462 into main Dec 11, 2020
@maciejwalkowiak maciejwalkowiak deleted the gh-1099 branch December 11, 2020 10:08
This pull request was closed.
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.

Failed to capture traces if sentry-trace header exists
4 participants