Skip to content

Instantly share code, notes, and snippets.

@sprsquish
Created March 31, 2014 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sprsquish/9898660 to your computer and use it in GitHub Desktop.
Save sprsquish/9898660 to your computer and use it in GitHub Desktop.
package com.twitter.zipkin.collector
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.server.TwitterServer
import com.twitter.util.{Await, Future}
import com.twitter.zipkin.storage.cassandra.CassieSpanStoreFactory
import com.twitter.zipkin.common.Span
import com.twitter.zipkin.receiver.scribe.ScribeSpanReceiverFactory
import com.twitter.zipkin.storage.WriteSpanStore
import com.twitter.zipkin.zookeeper.ZooKeeperClientFactory
object ZipkinCollectorServer extends TwitterServer
with ZipkinQueuedCollectorFactory
with CassieSpanStoreFactory
with ZooKeeperClientFactory
with ScribeSpanReceiverFactory
{
def newReceiver(receive: Seq[Span] => Future[Unit], stats: StatsReceiver): SpanReceiver =
newScribeSpanReceiver(receive, stats.scope("scribeSpanReceiver"))
def newSpanStore(stats: StatsReceiver): WriteSpanStore =
newCassieStore(stats.scope("cassie"))
def main() {
val collector = newCollector(statsReceiver)
onExit { collector.close() }
Await.ready(collector)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment