diff options
author | Jakob Odersky <jakob@driver.xyz> | 2017-10-04 15:52:20 -0700 |
---|---|---|
committer | Jakob Odersky <jakob@driver.xyz> | 2017-10-04 15:52:20 -0700 |
commit | e4753fb1ab68f738d51a0e7b2d9dffdfbd5ad998 (patch) | |
tree | e367a3bf6ef50f5a0e34549ece4f073644481897 | |
parent | 50985bc8f889176d360d8ab1ce1d880bd4d9c766 (diff) | |
download | tracing-e4753fb1ab68f738d51a0e7b2d9dffdfbd5ad998.tar.gz tracing-e4753fb1ab68f738d51a0e7b2d9dffdfbd5ad998.tar.bz2 tracing-e4753fb1ab68f738d51a0e7b2d9dffdfbd5ad998.zip |
Update readme
-rw-r--r-- | README.md | 45 |
1 files changed, 39 insertions, 6 deletions
@@ -1,17 +1,50 @@ # Driver Tracing Library -A vendor-neutral, pure-Scala [1] tracing library for Akka-HTTP. - -[1] Pure-Scala, in this context, refers to no direct Java library -dependencies. Dependencies are kept to a minimum, however it is -possible that Java libraries may be included transitively. +A vendor-neutral tracing library for Akka-HTTP. This library provides tracing directives for Akka-HTTP. It specifies common client abstractions and implementations that may be used with different tracing solutions, such as Google Stackdriver Tracing. ## Getting Started -TODO + +Driver tracing is published to maven central as a standard Scala +library. Include it in sbt by adding the following snippet to your +build.sbt: + +```scala +libraryDependencies += "xyz.driver" %% "tracing" % "0.0.1" +``` + +### Example +```scala +import xyz.driver.tracing._ +import xyz.driver.tracing.TracingDirectives._ + +val tracer = new LoggingTracer(println) + +val route = + // report how long any request to this service takes + trace(tracer) { + path("my-service-endpoint") { + get { + // include a sub-trace with a custom name + trace(tracer, Some("complex-call")) { + // do something that takes time + complete("done") + } + } + } ~ + path("proxy-service-endpoint") { + // extract tracing headers so they may be injected into nested requests + extractTraceHeaders{ headers => + // call external service with the existing parent tracing headers + complete("done") + } + } + } + +``` ## Tracing Backends |