Skip to content

Instantly share code, notes, and snippets.

@padurean
Last active December 22, 2015 11:56
Show Gist options
  • Save padurean/deb324ecbb3fec9bc342 to your computer and use it in GitHub Desktop.
Save padurean/deb324ecbb3fec9bc342 to your computer and use it in GitHub Desktop.
Zipkin tracing in Finch

padurean 12:52 Hi, guys I am new here, working in Scala & Play currently but i want to start a project using Finch and i would like to know if i can use Finagle modules with Finch and how - for example the Zipkin module (which i can not find between Finch modules)

thanks in advance

P.S. a link to some article describing this should be enough

padurean 12:53 found this older discussion on Zipkin:

@jtjeferreira I believe it should just work with Zipkin, since Finch operates over simple Finagle services. Can you check if it works when you replace Finch endpoint with just a Finagle service Service[HttpRequest, HttpResponse]?

vkostyukov 17:33 @padurean I don't see a reason why Zipkin wouldn't work with Finch since (as mentioned in the older discussion you've found) Finch only generates Finagle services, but not replaces Finagle itself. What happens when you try something like this (given that you have a dependency to finagle-zipkin)?

import com.twitter.finagle.param
val endpoint: Endpoint[String] = ???
val zipkin: ZipkinTracer = ???
val server = Http.server.configured(param.Tracer(zipkin)).serve(":8081", endpoint.toService)

padurean 18:52 @vkostyukov thanks - will try that. At this point i was just reading and wondering (Zipkin seems like a nice to have so i was curious if it works ootb) another thing which i don't really get (this might sound dumb, but ...): i saw TwitterServer and some GH project that reprezented a blueprint for a Finch + TwitterServer. Does Finch need TwitterServer? Why? padurean 19:01 i assume it doesn't need it, but it would be recommended to use Finch with a TwitterServer structure?

vkostyukov 19:01 @padurean That's not a dumb question at all. Finch definitely doesn't need TwitterServer to run/serve its endpoints. Although, you (as a developer) might need TwitterServer to simplify your life. TwitterServer is an extremally lightweight server template that gives you a lot of nice features like command line flags, logging and more importantly http admin interface that can tell you a lot about your server: from thread dumps to finagle/user-defined metrics (i.e., number of requests that succed, number of failed request, JVM metrics, etc). With that said, I'd recommend you to use TwitterServer with Finch whenwever possible. See Todo.scala for an example configuration.

padurean 19:16 @vkostyukov - alright - thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment