openzipkin / zipkin-js

Zipkin instrumentation for Node.js and browsers
Apache License 2.0
565 stars 171 forks source link

Allow request sampler for server #437

Open jcchavezs opened 5 years ago

jcchavezs commented 5 years ago

I have been checking the possibility of having the zipkin middleware only for specific routes and found it VERY cumbersome. My use case is that I don't want to trace _health calls in a node server.

Hence I want to open a discussion about requestSampler as we do have in zipkin-go and brave. This might do the trick, see https://github.com/openzipkin/zipkin-go/blob/master/middleware/http/server.go#L69

Ping @ghermeto @shumsky @adriancole

codefromthecrypt commented 5 years ago

I think we can implement this in a way that works for the current api as most samplers dont actually use the tracer in any way. mostly they need an abstraction of the http request including normal route parameters like method path host and headers

On Fri, Aug 9, 2019, 8:22 PM José Carlos Chávez notifications@github.com wrote:

I have been checking the possibility of having the zipkin middleware only for specific routes and found it VERY cumbersome. My use case is that I don't want to trace _health calls in a node server.

- https://stackoverflow.com/questions/31331606/how-can-i-add-a-middleware-in-my-route

Hence I want to open a discussion about requestSampler as we do have in zipkin-go and brave. This might do the trick.

Ping @ghermeto https://github.com/ghermeto @shumsky https://github.com/shumsky @adriancole https://github.com/adriancole

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openzipkin/zipkin-js/issues/437?email_source=notifications&email_token=AAAPVV7UGPQMIIY4E5TO2TTQDVOO5A5CNFSM4IKTQEFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HEMKX6A, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPVV4WWQWDZIVBK6VPEEDQDVOO5ANCNFSM4IKTQEFA .