Kamon is an instrumentation toolkit for applications running on the JVM. With Kamon you can record metrics, trace requests and propagate context across distributed systems without locking your service to a specific metrics or tracing vendor.
From a bird’s eye view, Kamon can be decomposed in three main components: the core APIs for metrics, tracing and context propagation; the automatic instrumentation modules and the reporting modules. Your services’ code will only ever interact with Kamon’s APIs and abstract you away from how and where the collected data will end up going to.
kamon-core project contains the basic building blocks upon which every other module is built and the only API
surface that you need to understand and interact with if using Kamon directly (see automatic instrumentation). The core
module can be divided into three main sections:
There exists a growing number of automatic instrumentation modules that hook into the internals of several widely used frameworks and libraries to bring metrics, traces and context propagation without the need to use the Core APIs directly. Some examples are:
kamon-akka-remotemodules provides actor, router, dispatcher and actor group metrics, distributed message tracing and context propagation both locally and across a cluster.
kamon-playmodules provide automatic context propagation and distributed tracing on both the server and client sides of Akka HTTP and Play Framework, respectively.
kamon-jdbcmodule hooks into all JDBC calls, creating Spans for each operation and tracking Hikari CP metrics when possible.
When using these modules it is necessary for applications to run with the bytecode instrumentation agent.
Finally, the reporter modules send and/or expose all the collected data to several monitoring systems. There are two types of reporting modules:
Creating new reporters is just about implementing the appropriate interfaces and calling
starting your services.