-
Notifications
You must be signed in to change notification settings - Fork 38
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
How to set component_span with Rack middleware? #96
Comments
the span name is currently hard-set. It could be possible to add a naming function instead, which could compose the value. A lot of instrumentation do things like this. https://github.com/openzipkin/zipkin-ruby/blob/master/lib/zipkin-tracer/rack/zipkin-tracer.rb#L24 |
What if we change it to
Since this is a default, it might be better to more explicit...? (Although I have zero context so this is just for my use case.) I would be happy to do a PR. |
PATH_INFO is likely to be variable, right? If so, it would explode the
cardinality of span names which would cause usability (and also UI
performance problems). The span name is a label in the UI.
I think the default should be left alone, but allow a function of env to be
passed to customize. For example, that could clean up or otherwise format
PATH_INFO such that it doesn't repeat endlessly (such as something with an
identifier in it would). For those who happen to have low cardinality
paths, they could choose to put the function you mention.
sg?
|
seems there's a long discussion of how to get what's currently referred to as "http.route" from the rails env https://stackoverflow.com/questions/42691729/how-to-find-current-abstract-route-in-rails-middware see openzipkin/zipkin-api#42 for http.route |
I'm not exactly clear how to use the change in https://github.com/openzipkin/zipkin-api/pull/42/files to now get the route in the span name. How do I use HTTP_ROUTE in zipkin-ruby? Do I still want to do something like what @georgeu2000 suggested above, but instead do
and pass the route into env['PATH_ROUTE'] using what's described in your stackoverflow link? |
here's the route-based span name logic we use in java if that helps? https://github.com/openzipkin/brave/blob/master/instrumentation/http/src/main/java/brave/http/HttpParser.java#L94 |
OK I think I figured it out https://github.com/openzipkin/zipkin-ruby/pull/122/files. This looks good for our Rails app. Can you please review? |
We have the following config for a Sinatra App:
The span is displayed as "post", which I guess comes from the request method. How can I set it to request method and request path?
The text was updated successfully, but these errors were encountered: