Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@huntc
Created February 25, 2018 07:22
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 huntc/526632808a3790e19973a7ff25421ba3 to your computer and use it in GitHub Desktop.
Save huntc/526632808a3790e19973a7ff25421ba3 to your computer and use it in GitHub Desktop.
private val tracerConfig = new Configuration(
config.getString("lora-server.jaeger.service-name"),
if (config.getBoolean("lora-server.jaeger.constant-sampling"))
new SamplerConfiguration("const", 1)
else new SamplerConfiguration(),
new ReporterConfiguration(
true, // logSpans
config.getString("lora-server.jaeger.agent-host"),
config.getInt("lora-server.jaeger.agent-port"),
config.getDuration("lora-server.jaeger.flush-interval").toMillis.toInt,
config.getInt("lora-server.jaeger.max-buffered-spans")
)
)
...
val tracer = tracerConfig.getTracer
def dataUpReceivedToDecryptEventBegin(spanContext: SpanContext): Span = {
val scope =
tracer
.buildSpan("data-up-received-to-decrypt")
.addReference(References.FOLLOWS_FROM, spanContext)
.startActive(false)
try {
scope.span()
} finally {
scope.close()
}
}
def dataUpReceivedToDecryptEventEnd(span: Span): Unit =
tracer.scopeManager().activate(span, true).close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment