Created
February 25, 2018 07:22
-
-
Save huntc/526632808a3790e19973a7ff25421ba3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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