diff options
author | John St. John <jstjohn@users.noreply.github.com> | 2017-09-21 16:28:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 16:28:23 -0700 |
commit | 9b0bed19489dbbd59c52a77e9c0c080a880ca262 (patch) | |
tree | 74934c57133ada3cd84a5c8a702cdf2683e8881e /src/main/scala/xyz/driver/core/trace/GoogleServiceTracer.scala | |
parent | 037f522caf47d70d674daba62b540a451542c64d (diff) | |
download | driver-core-1.0.1.tar.gz driver-core-1.0.1.tar.bz2 driver-core-1.0.1.zip |
Jstjohn/google stackdriver trace (#64)v1.0.1
Add app-level tracing to driver-core (https://www.pivotaltracker.com/story/show/151100422)
Diffstat (limited to 'src/main/scala/xyz/driver/core/trace/GoogleServiceTracer.scala')
-rw-r--r-- | src/main/scala/xyz/driver/core/trace/GoogleServiceTracer.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/core/trace/GoogleServiceTracer.scala b/src/main/scala/xyz/driver/core/trace/GoogleServiceTracer.scala new file mode 100644 index 0000000..ead4c6f --- /dev/null +++ b/src/main/scala/xyz/driver/core/trace/GoogleServiceTracer.scala @@ -0,0 +1,14 @@ +package xyz.driver.core.trace + +import akka.http.scaladsl.model.headers.RawHeader +import com.google.cloud.trace.Tracer +import com.google.cloud.trace.core.{SpanContextFactory, TraceContext} + +final case class GoogleStackdriverTraceSpan(tracer: Tracer, context: TraceContext) extends CanMakeHeader { + def header: RawHeader = + RawHeader(TracingHeaderKey, SpanContextFactory.toHeader(context.getHandle.getCurrentSpanContext)) +} + +trait GoogleServiceTracer extends ServiceTracer { + type TracerSpanPayload = GoogleStackdriverTraceSpan +} |