Storage

object Storage
Companion:
class
class Object
trait Matchable
class Any
Storage.type

Type members

Classlikes

A ThreadLocal context storage that allows the scope to be closed in a different thread than the thread where store(..) was called. This is roughly 25% slower than kamon.context.Storage.ThreadLocal but is required for certain library integrations such as cats-effect IO or Monix. Turn this on by setting the System Property "kamon.context.crossThread" to "true".

A ThreadLocal context storage that allows the scope to be closed in a different thread than the thread where store(..) was called. This is roughly 25% slower than kamon.context.Storage.ThreadLocal but is required for certain library integrations such as cats-effect IO or Monix. Turn this on by setting the System Property "kamon.context.crossThread" to "true".

Companion:
object
Companion:
class
class Debug extends Storage

A Storage implementation that keeps track of all Contexts across all Threads in the application and exposes them through its companion object. Using the Debug storage can only be enabled when the System Property "kamon.context.debug" is set to "true" (we don't allow this be discovered from configuration because it can cause initialization issues when Kamon is first initialized via instrumentation trying to access the current Context).

A Storage implementation that keeps track of all Contexts across all Threads in the application and exposes them through its companion object. Using the Debug storage can only be enabled when the System Property "kamon.context.debug" is set to "true" (we don't allow this be discovered from configuration because it can cause initialization issues when Kamon is first initialized via instrumentation trying to access the current Context).

This implementation is considerably less efficient than the default implementation since it is taking at least two different stack traces for every store/close operation pair. Do not use this for any reason other than debugging Context propagation issues (like, dirty Threads) in a controlled environment.

Companion:
object
object Debug
Companion:
class
object Scope
Companion:
class
trait Scope extends AutoCloseable

Encapsulates the extend during which a Context is held by an Storage implementation. Once a Scope is closed, the Context will be removed from the Storage that created the Scope.

Encapsulates the extend during which a Context is held by an Storage implementation. Once a Scope is closed, the Context will be removed from the Storage that created the Scope.

Companion:
object
class ThreadLocal extends Storage

Wrapper that implements an optimized ThreadLocal access pattern ideal for heavily used ThreadLocals. It is faster to use a mutable holder object and always perform ThreadLocal.get() and never use ThreadLocal.set(), because the value is more likely to be found in the ThreadLocalMap direct hash slot and avoid the slow path of ThreadLocalMap.getEntryAfterMiss(). WARNING: Closing of the returned Scope MUST be called in the same thread as store(..) was originally called.

Wrapper that implements an optimized ThreadLocal access pattern ideal for heavily used ThreadLocals. It is faster to use a mutable holder object and always perform ThreadLocal.get() and never use ThreadLocal.set(), because the value is more likely to be found in the ThreadLocalMap direct hash slot and avoid the slow path of ThreadLocalMap.getEntryAfterMiss(). WARNING: Closing of the returned Scope MUST be called in the same thread as store(..) was originally called.

Credit to @trask from the FastThreadLocal in glowroot. One small change is that we don't use an kamon-defined holder object as that would prevent class unloading.

Companion:
object
Companion:
class