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

Rename or rejig Sampler #92

Closed
codefromthecrypt opened this issue Jan 3, 2016 · 7 comments · Fixed by #829
Closed

Rename or rejig Sampler #92

codefromthecrypt opened this issue Jan 3, 2016 · 7 comments · Fixed by #829
Assignees
Milestone

Comments

@codefromthecrypt
Copy link
Contributor

Sampled returning false in sleuth is different than most instrumentation I've seen. For example, a span is managed regardless of whether it is sampled (i.e. still generates callbacks etc). The Sampled state controls the exportable field, which in turn controls propagation and storage (and a special-case for users of TraceManager.addAnnotation(key, value) as opposed to getCurrentSpan)

I'd suggest 2 paths, which could both be taken.

  • Rename Sampler to ShouldExport. Document the propagation and storage aspects there.
  • Move the ShouldExport logic to the end of a span. Since we are gathering a Span regardless anyway, we might as well use it in the export decision. In other words, change the invocation from before-the-fact (before a span id is created) until after-the-fact (when a span ends or times out).

If controlling overhead thing is an intended goal of the Sampler, then maybe the before-the-fact is still the right choice. I'd have a few suggestions on that.

  • Trim the state needed.. seems we shouldn't be creating callbacks and the like for unsampled spans. That or it should be clear why we do (maybe it is to others).
  • Expand guarding to things beyond storage, propagation, TraceManager.setAttribute, or invert the logic. Ex. don't use the Span object at all if not sampled.. use something different (assuming the goal of keeping it around is to coordinate ids or something).
@codefromthecrypt
Copy link
Contributor Author

here's a related issue with the ruby tracer, which was accidentally gathering state for spans that are tossed openzipkin/zipkin-ruby#40

@dsyer dsyer modified the milestone: 1.0.0.RC1 Feb 18, 2016
@dsyer dsyer modified the milestones: 1.0.0.RC1, 1.0.0.RC2 Mar 31, 2016
@dsyer dsyer modified the milestones: 1.0.0.RC2, 1.0.0 Apr 18, 2016
@marcingrzejszczak
Copy link
Contributor

I wouldn't do anything about this for the 1.0.0 release. Let's move it for the next big release.

@dsyer dsyer modified the milestones: 1.0.0, 1.0.1 May 11, 2016
@dsyer dsyer modified the milestones: 1.0.1, 1.0.2 Jun 11, 2016
@spencergibb spencergibb modified the milestones: 1.0.2, 1.1.0 Jul 2, 2016
@marcingrzejszczak marcingrzejszczak modified the milestones: 1.2.0.M1, 1.1.0.M1 Nov 24, 2016
@codefromthecrypt
Copy link
Contributor Author

since a year has passed, probably needs another look in case (my) understanding is better now

@marcingrzejszczak marcingrzejszczak removed this from the 1.2.0.M1 milestone Jan 16, 2017
@marcingrzejszczak
Copy link
Contributor

marcingrzejszczak commented Feb 23, 2017

I actually have an idea that we could leave the sampler as a name but maybe think of moving sampling as far as possible? Actually to the moment when the span is closed? That way users can do adaptive sampling (which is impossible ATM?). WDYT @adriancole ?

@codefromthecrypt
Copy link
Contributor Author

codefromthecrypt commented Feb 27, 2017 via email

@marcingrzejszczak
Copy link
Contributor

Thanks for the analysis. Makes perfect sense. I simplified the adaptive sampling issue. I think that we should close this one for now.

@marcingrzejszczak marcingrzejszczak added this to the 2.0.0.M6 milestone Jan 19, 2018
@marcingrzejszczak marcingrzejszczak self-assigned this Jan 19, 2018
marcingrzejszczak added a commit that referenced this issue Jan 19, 2018
with this pull request we have rewritten the whole Sleuth internals to use Brave. That way we can leverage all the functionalities & instrumentations that Brave already has (https://github.com/openzipkin/brave/tree/master/instrumentation).

Migration guide is available here: https://github.com/spring-cloud/spring-cloud-sleuth/wiki/Spring-Cloud-Sleuth-2.0-Migration-Guide

fixes #711 - Brave instrumentation
fixes #92 - we move to Brave's Sampler
fixes #143 - Brave is capable of passing context
fixes #255 - we've moved away from Zipkin Stream server
fixes #305 - Brave has GRPC instrumentation (https://github.com/openzipkin/brave/tree/master/instrumentation/grpc)
fixes #459 - Brave (openzipkin/brave#510) & Zipkin (openzipkin/zipkin#1754) will deal with the AWS XRay instrumentation
fixes #577 - Messaging instrumentation has been rewritten
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 a pull request may close this issue.

4 participants