Diego Parra|@diegolparra|Cristian Spinetta|@cebspinetta
Microservices: https://martinfowler.com/articles/microservices.html
Improved Modularity
Team Autonomy
Heterogeneous
Environmental Isolation
Better Functional Composition
Expectation
Reality
Which services did a request pass through?
Where are the bottlenecks?
How much time is lost due to network lag during communication between services?
What occurred in each service for a given request?
A few of the critical questions that DT can answer quickly and easily:
B3-Propagation https://github.com/openzipkin/b3-propagation
For a new trace, the root span would have a new TraceID, SpanID and no ParentSpanID.
For a child span continuing a trace, it would have the same TraceID as incomming request, a new SpanID and a ParentSpanID pointing to the incomming request's SpanID.
Sampled decision indicates if the Span must be reported to the tracing system.
Sampling reduces Overhead
Observability tools are unintrusive
Instrumentations can be delegated to commons frameworks
Don't trace every single operation
Distributed Tracing System
Based on Google Dapper (2010)
Created by Twitter (2012)
OpenZipkin (2015)
Active Community
Distributed Tracing System
Based on Google Dapper (2010)
Inspired by OpenZipkin
Created by Uber
Distributed Tracing, Metrics and Context Propagation for application running on the JVM.
- Observability SDK(metrics, tracing).
Trace instrumentation API definitions.
- OpenZipkin's java library and instrumentation.
// build.sbt
libraryDependencies ++= Seq(
"io.kamon" %% "kamon-core" % "1.1.3",
"io.kamon" %% "kamon-prometheus" % "1.1.3",
"io.kamon" %% "kamon-zipkin" % "1.1.3",
"io.kamon" %% "kamon-jaeger" % "1.1.3")
Add Dependencies
// application.conf
kamon {
environment {
service = "kamon-showcase"
}
trace {
sampler = "random"
}
}
Add Configuration
Kamon.addReporter(new PrometheusReporter())
Kamon.addReporter(new ZipkinReporter())
// OR
Kamon.loadReportersFromConfig()
Start the Reporters
java -javaagent:/path/to/kanela-agent.jar
Start with Kanela (optional step)
val span = Kamon.buildSpan("find-users")
.withTag("span.kind", "server")
.withTag("string-tag", "hello")
.withTag("number-tag", 42)
.withTag("boolean-tag", true)
.withMetricTag("early-tag", "value")
.start()
// Do your stuff here
span.finish()
// You got traces, you got metrics!
Using a Span
Or
@Trace(operationName = "find-users", tags = "${'span.kind':'server', 'string-tag':'hello'}")
public List<Users> findUsers(List<Long> ids) {}
Annotate your Service
@Trace(operationName = "find-users", tags = "${'span.kind':'server', 'string-tag':'hello'}")
def findUsers(ids:Seq[Long]): Seq[Users]
Java
Scala
Planned:
Get more info at http://kamon.io/
https://github.com/kamon-io
@kamonteam