Skip to content

Instantly share code, notes, and snippets.

@huntc huntc/setup.scala
Created Feb 25, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.