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

Handle when zipkin_attrs are passed in and sampled correctly #10

Merged
merged 2 commits into from
Sep 30, 2016

Conversation

mjbryant
Copy link

When sampled zipkin_attrs are passed into zipkin_span along with a sample_rate param, new zipkin_attrs are generated, even when they shouldn't be. This fixes that.

I also renamed the 'is_root' to 'perform_logging' and moved the logic around a bit. I can't recall if we've discussed this before, but I still find the 'is_root' variable name to be confusing. I'm open to changing that part back if anyone feels strongly.

Finally, added a regression test for the correct zipkin_attrs + sampling logic.

…d, but the zipkin_span also has a sample_rate argument
if self.sample_rate is not None:
self.is_root = True

# This clause allows for sampling this service independently
Copy link
Member

Choose a reason for hiding this comment

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

just to clarify for my own understanding, this means that sample_rate is the sampling rate of all requests that are not already sampled by a parent caller? so the actual tracing rate of the service is potentially higher than the specified sample_rate.

Copy link
Member

Choose a reason for hiding this comment

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

if so i think it'll be worth mentioning this in the docstring for the sample_rate param

Copy link
Author

Choose a reason for hiding this comment

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

Yes, this is true, but it was true before this PR. I will update the docs.

Copy link
Member

Choose a reason for hiding this comment

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

oh yeah 😣 thanks for adding documentation that i should have added! 😅

@kaisen
Copy link
Member

kaisen commented Sep 30, 2016

:shipit:

@coveralls
Copy link

coveralls commented Sep 30, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 1f65c89 on mbryant-fix-passed-zipkin-attrs-and-sampled-logic into fc19d1d on master.

@coveralls
Copy link

coveralls commented Sep 30, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 1f65c89 on mbryant-fix-passed-zipkin-attrs-and-sampled-logic into fc19d1d on master.

@mjbryant mjbryant merged commit 70aa000 into master Sep 30, 2016
@drolando drolando deleted the mbryant-fix-passed-zipkin-attrs-and-sampled-logic branch June 6, 2018 00:05
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.

None yet

3 participants