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

Question: Can I configure a sampling rate? #8

Closed
kop opened this issue Nov 2, 2017 · 10 comments
Closed

Question: Can I configure a sampling rate? #8

kop opened this issue Nov 2, 2017 · 10 comments

Comments

@kop
Copy link

kop commented Nov 2, 2017

Hi,

Thank you for this module, looks really great.
However, I'm a little bit scary to enable this on production nginx. I was not able to find any control on amount tracing spans to create. Do I understand correctly that it will create a span for every request?

For high production traffic, it would be great to have an option to trace only, let's say, 0.5% or 1% of the requests.

@rnburn
Copy link
Collaborator

rnburn commented Nov 2, 2017

Sampling is usually done as a feature of the tracing libraries. I'm ok adding it to zipkin-cpp-opentracing and exposing it as an option.

I believe the Jaeger implementation already has an option for this, though I don't know if it's quite ready for use yet.

@kop
Copy link
Author

kop commented Nov 2, 2017

@rnburn thank you for the answer.

Jaeger is the tracer I'm using and I'm asking because I don't know any way how to configure this in Jaeger agent. This option is available in all Jaeger client libraries and I was expecting it to be here too.

It would be great to have such option.

@rnburn
Copy link
Collaborator

rnburn commented Nov 2, 2017

Adding @isaachier, @yurishkuro to see if they can answer.

I think the library is still under development so it may not have all the options yet.

@isaachier
Copy link
Contributor

Yes there is a way and I have a fork of this project in development now. Builds on docker but haven't tested it yet.

@yurishkuro
Copy link

while Jaeger clients provide a way to configure sampling priority, the default mode we recommend is letting the clients pull the sampling strategy from Jaeger backend (cf. jaegertracing/jaeger#365).

@rnburn
Copy link
Collaborator

rnburn commented Nov 8, 2017

@kop I think this is the option to set the agent host and port if that's what you're looking for.

@kop
Copy link
Author

kop commented Nov 9, 2017

while Jaeger clients provide a way to configure sampling priority, the default mode we recommend is letting the clients pull the sampling strategy from Jaeger backend (cf. jaegertracing/jaeger#365).

This sounds great and should be much easier to work with, however this is something from the future. We still need a way to set sampling rate for current usage.

@kop I think this is the option to set the agent host and port if that's what you're looking for.

Thank you, this is not exactly what was my question about :)

@rnburn
Copy link
Collaborator

rnburn commented Nov 14, 2017

@kop I just put in some fixes to make the Jaeger module work. I did some testing and I believe writing something like this in your nginx.conf will give you what you want:

 http {
    opentracing on;
    jaeger_service_name test-nginx;
    jaeger_sampler_type probabilistic;
    jaeger_sampler_param 0.01; # Sample 10% of requests.

But note that there's a bug in Jaeger if you try to use a sample param of 100% (jaegertracing/jaeger-client-cpp#6).

@isaachier -- Could you document the different options available for jaeger_sampler_type? I had to grep through Jaeger's code to find this.

@isaachier
Copy link
Contributor

Sure thing. Not sure when but soon enough.

@rnburn
Copy link
Collaborator

rnburn commented Nov 16, 2017

Closing. If you also want sampling for zipkin, please put in an issue to https://github.com/rnburn/zipkin-cpp-opentracing.

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

No branches or pull requests

4 participants