openzipkin / zipkin-ruby

zipkin-tracer ruby gem
Apache License 2.0
99 stars 40 forks source link

Feature request: Grape compatibility #128

Open yellowred opened 5 years ago

yellowred commented 5 years ago

Hi,

This gem helps to trace incoming requests, however in case of API made with popular API framework Grape it fails to help. The reason for that is Grape having it's own storage for routes.

Before release 0.29.0 of zipkin-ruby it was possible to patch routable_request? method adding:

return true if Grape::API.recognize_path(path_info)

But with the new version get_route also needs to be patched to get rid of extra slash in the beginning of request.path (env[SCRIPT_NAME] becomes updated because of this line https://github.com/openzipkin/zipkin-ruby/blob/7c504946e6498a67cb8e773a3547c3fe251535c9/lib/zipkin-tracer/application.rb#L16). It seems either Grape is included in the roadmap or it will become incompatible with zipkin.

codefromthecrypt commented 5 years ago

is this something you can help with?

On Tue, 23 Oct 2018, 13:12 Oleg Kubrakov, notifications@github.com wrote:

Hi,

This gem helps to trace incoming requests, however in case of API made with popular API framework Grape it fails to help. The reason for that is Grape having it's own storage for routes.

Before release 0.29.0 of zipkin-ruby it was possible to patch routable_request? method adding:

return true if Grape::API.recognize_path(path_info)

But with the new version get_route also needs to be patched to get rid of extra slash in the beginning of request.path (env[SCRIPT_NAME] becomes updated). It seems either Grape is included in the roadmap or it will become incompatible with zipkin.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openzipkin/zipkin-ruby/issues/128, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD61wzIGJEZ-18JvyP7KKy3UyegNlZ3ks5unqUtgaJpZM4X0txp .