This library was built to make the kotlin/opentracing integration more fluid, avoiding boilerplate code.
core: The basic opentracing kotlin integration
springboot-support: Additional utilities to integrate with spring-boot 1.5, configuration and method annotation
1 - Initialize the tracer
OpenTracing.configure(
OpenTracingConfiguration(
"your token",
"collector host",
"collector port",
"service name"
)
)
2 - Import the OpenTracing.trace
and trace your code
trace("some_operation"){
// some very special piece of code here
}
3 - Spring support with the @Treceable
annotation
@GetMapping("/stuff")
@Traceable("list_stuff")
List<Stuff> list() {
return repository.findAll()
}
Gradle repository
maven {
url "https://dl.bintray.com/ribeiropt/maven"
}
dependencies
compile "io.github.brunoribeiro:opentracing-kotlin-core:${latestVersion}"