object Kamon extends Configuration with Utilities with Metrics with Tracing with ModuleManagement with ContextPropagation with ContextStorage with CurrentStatus with Init
- Alphabetic
- By Inheritance
- Kamon
- Init
- CurrentStatus
- ContextStorage
- ContextPropagation
- ModuleManagement
- Tracing
- Metrics
- MetricBuilding
- Utilities
- Configuration
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val _metricRegistry: MetricRegistry
- Attributes
- protected
- Definition Classes
- Metrics
- val _moduleRegistry: ModuleRegistry
- Attributes
- protected
- Definition Classes
- ModuleManagement
- def addReporter(name: String, description: String, reporter: MetricReporter, metricFilter: Filter): Registration
- Definition Classes
- ModuleManagement
- def addReporter(name: String, reporter: MetricReporter, metricFilter: Filter): Registration
- Definition Classes
- ModuleManagement
- def addReporter(name: String, reporter: MetricReporter): Registration
- Definition Classes
- ModuleManagement
- def addReporter(name: String, description: String, reporter: SpanReporter): Registration
- Definition Classes
- ModuleManagement
- def addReporter(name: String, reporter: SpanReporter): Registration
- Definition Classes
- ModuleManagement
- def addScheduledAction(name: String, description: Option[String], collector: ScheduledAction, interval: Duration): Registration
- Definition Classes
- ModuleManagement
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attachInstrumentation(): Unit
Tries to attach the Kanela instrumentation agent, if the Kamon Bundle dependency is available on the classpath.
Tries to attach the Kanela instrumentation agent, if the Kamon Bundle dependency is available on the classpath. If the Status module indicates that instrumentation has been already applied this method will not try to do anything.
- Definition Classes
- Init
- def binaryPropagation(channelName: String): Option[Propagation[ByteStreamReader, ByteStreamWriter]]
Retrieves the binary propagation channel with the supplied name.
Retrieves the binary propagation channel with the supplied name. Propagation channels are configured on the kamon.propagation.binary configuration section.
- Definition Classes
- ContextPropagation
- def clearRegistry(): Unit
- Attributes
- protected
- Definition Classes
- Metrics
- def clientSpanBuilder(operationName: String, component: String): SpanBuilder
Creates a new SpanBuilder for a Client Span and applies the provided component name as a metric tag.
Creates a new SpanBuilder for a Client Span and applies the provided component name as a metric tag. It is recommended that all Spans include a "component" metric tag that indicates what library or library section is generating the Span.
- Definition Classes
- Tracing
- def clock(): Clock
Kamon's Clock implementation.
Kamon's Clock implementation.
- Definition Classes
- Utilities
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def config(): Config
Retrieve Kamon's current configuration.
Retrieve Kamon's current configuration.
- Definition Classes
- Configuration
- def consumerSpanBuilder(operationName: String, component: String): SpanBuilder
Creates a new SpanBuilder for a Consumer Span and applies the provided component name as a metric tag.
Creates a new SpanBuilder for a Consumer Span and applies the provided component name as a metric tag. It is recommended that all Spans include a "component" metric tag that indicates what library or library section is generating the Span.
- Definition Classes
- Tracing
- def counter(name: String, description: String, settings: ForValueInstrument): Counter
Creates or retrieves a Counter-backed metric with the provided settings
Creates or retrieves a Counter-backed metric with the provided settings
- Definition Classes
- MetricBuilding
- def counter(name: String, description: String, unit: MeasurementUnit): Counter
Creates or retrieves a Counter-backed metric with the provided unit
Creates or retrieves a Counter-backed metric with the provided unit
- Definition Classes
- MetricBuilding
- def counter(name: String, unit: MeasurementUnit): Counter
Creates or retrieves a Counter-backed metric with the provided unit
Creates or retrieves a Counter-backed metric with the provided unit
- Definition Classes
- MetricBuilding
- def counter(name: String, description: String): Counter
Creates or retrieves a Counter-backed metric
Creates or retrieves a Counter-backed metric
- Definition Classes
- MetricBuilding
- def counter(name: String): Counter
Creates or retrieves a Counter-backed metric
Creates or retrieves a Counter-backed metric
- Definition Classes
- MetricBuilding
- def currentContext(): Context
Returns the current Context on Kamon's Context Storage.
Returns the current Context on Kamon's Context Storage. As the default behavior, this will return Context.Empty if no other Context has been stored on the calling thread.
- Definition Classes
- ContextStorage
- def currentSpan(): Span
Returns the Span held by the current Context, if any.
Returns the Span held by the current Context, if any. As the default behavior, this will return Span.Empty if the current Context does not contain a Span.
- Definition Classes
- ContextStorage
- def defaultBinaryPropagation(): Propagation[ByteStreamReader, ByteStreamWriter]
Retrieves the default binary propagation channel.
Retrieves the default binary propagation channel. Configuration for this channel can be found under the kamon.propagation.binary.default configuration section.
- Definition Classes
- ContextPropagation
- def defaultHttpPropagation(): Propagation[HeaderReader, HeaderWriter]
Retrieves the default HTTP propagation channel.
Retrieves the default HTTP propagation channel. Configuration for this channel can be found under the kamon.propagation.http.default configuration section.
- Definition Classes
- ContextPropagation
- def enabled(): Boolean
- Definition Classes
- Configuration
- def environment: Environment
Returns the current enviroment instance constructed by Kamon using the "kamon.environment" settings.
Returns the current enviroment instance constructed by Kamon using the "kamon.environment" settings.
- Definition Classes
- CurrentStatus
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def filter(configKey: String): Filter
Creates a new composite Filter by looking up the provided key on Kamon's configuration.
Creates a new composite Filter by looking up the provided key on Kamon's configuration. All inputs matching any of the include filters and none of the exclude filters will be accepted. The configuration is expected to have the following structure:
config { includes = [ "some/pattern", "regex:some[0-9]" ] excludes = [ ] }
By default, the patterns are treated as Glob patterns but users can explicitly configure the pattern type by prefixing the pattern with either "glob:" or "regex:". If any of the elements are missing they will be considered empty.
- Definition Classes
- Utilities
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def gauge(name: String, description: String, settings: ForValueInstrument): Gauge
Creates or retrieves a Gauge-backed metric with the provided settings
Creates or retrieves a Gauge-backed metric with the provided settings
- Definition Classes
- MetricBuilding
- def gauge(name: String, description: String, unit: MeasurementUnit): Gauge
Creates or retrieves a Gauge-backed metric with the provided unit
Creates or retrieves a Gauge-backed metric with the provided unit
- Definition Classes
- MetricBuilding
- def gauge(name: String, unit: MeasurementUnit): Gauge
Creates or retrieves a Gauge-backed metric with the provided unit
Creates or retrieves a Gauge-backed metric with the provided unit
- Definition Classes
- MetricBuilding
- def gauge(name: String, description: String): Gauge
Creates or retrieves a Gauge-backed metric
Creates or retrieves a Gauge-backed metric
- Definition Classes
- MetricBuilding
- def gauge(name: String): Gauge
Creates or retrieves a Gauge-backed metric
Creates or retrieves a Gauge-backed metric
- Definition Classes
- MetricBuilding
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def histogram(name: String, description: String, settings: ForDistributionInstrument): Histogram
Creates or retrieves a Histogram-backed metric with the provided settings
Creates or retrieves a Histogram-backed metric with the provided settings
- Definition Classes
- MetricBuilding
- def histogram(name: String, description: String, unit: MeasurementUnit, dynamicRange: DynamicRange): Histogram
Creates or retrieves a Histogram-backed metric with the provided unit and dynamic range
Creates or retrieves a Histogram-backed metric with the provided unit and dynamic range
- Definition Classes
- MetricBuilding
- def histogram(name: String, unit: MeasurementUnit, dynamicRange: DynamicRange): Histogram
Creates or retrieves a Histogram-backed metric with the provided unit and dynamic range
Creates or retrieves a Histogram-backed metric with the provided unit and dynamic range
- Definition Classes
- MetricBuilding
- def histogram(name: String, description: String, unit: MeasurementUnit): Histogram
Creates or retrieves a Histogram-backed metric with the provided unit
Creates or retrieves a Histogram-backed metric with the provided unit
- Definition Classes
- MetricBuilding
- def histogram(name: String, unit: MeasurementUnit): Histogram
Creates or retrieves a Histogram-backed metric with the provided unit
Creates or retrieves a Histogram-backed metric with the provided unit
- Definition Classes
- MetricBuilding
- def histogram(name: String, description: String): Histogram
Creates or retrieves a Histogram-backed metric
Creates or retrieves a Histogram-backed metric
- Definition Classes
- MetricBuilding
- def histogram(name: String): Histogram
Creates or retrieves a Histogram-backed metric
Creates or retrieves a Histogram-backed metric
- Definition Classes
- MetricBuilding
- def httpPropagation(channelName: String): Option[Propagation[HeaderReader, HeaderWriter]]
Retrieves the HTTP propagation channel with the supplied name.
Retrieves the HTTP propagation channel with the supplied name. Propagation channels are configured on the kamon.propagation.http configuration section.
- Definition Classes
- ContextPropagation
- def identifierScheme: Scheme
Returns the Identifier Scheme currently used by the tracer.
Returns the Identifier Scheme currently used by the tracer.
- Definition Classes
- Tracing
- def init(config: Config): Unit
Reconfigures Kamon to use the provided configuration and then attempts to attach the instrumentation agent and start all registered modules.
Reconfigures Kamon to use the provided configuration and then attempts to attach the instrumentation agent and start all registered modules.
- Definition Classes
- Init
- def init(): Unit
Attempts to attach the instrumentation agent and start all registered modules.
Attempts to attach the instrumentation agent and start all registered modules.
- Definition Classes
- Init
- def initWithoutAttaching(config: Config): Unit
Initializes Kamon without trying to attach the instrumentation agent from the Kamon Bundle.
Initializes Kamon without trying to attach the instrumentation agent from the Kamon Bundle.
- Definition Classes
- Init
- def initWithoutAttaching(): Unit
Initializes Kamon without trying to attach the instrumentation agent from the Kamon Bundle.
Initializes Kamon without trying to attach the instrumentation agent from the Kamon Bundle.
- Definition Classes
- Init
- def internalSpanBuilder(operationName: String, component: String): SpanBuilder
Creates a new SpanBuilder for an Internal Span and applies the provided component name as a metric tag.
Creates a new SpanBuilder for an Internal Span and applies the provided component name as a metric tag. It is recommended that all Spans include a "component" metric tag that indicates what library or library section is generating the Span.
- Definition Classes
- Tracing
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def loadModules(): Unit
Loads modules from Kamon's configuration.
Loads modules from Kamon's configuration.
- Definition Classes
- ModuleManagement
- def moduleRegistry(): ModuleRegistry
- Attributes
- protected
- Definition Classes
- ModuleManagement
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def onReconfigure(hook: (Config) => Unit): Unit
Register a reconfigure hook that will be run when the a call to Kamon.reconfigure(config) is performed.
Register a reconfigure hook that will be run when the a call to Kamon.reconfigure(config) is performed. All registered hooks will run sequentially in the same Thread that calls Kamon.reconfigure(config).
- Definition Classes
- Configuration
- def onReconfigure(hook: OnReconfigureHook): Unit
Register a reconfigure hook that will be run when the a call to Kamon.reconfigure(config) is performed.
Register a reconfigure hook that will be run when the a call to Kamon.reconfigure(config) is performed. All registered hooks will run sequentially in the same Thread that calls Kamon.reconfigure(config).
- Definition Classes
- Configuration
- def producerSpanBuilder(operationName: String, component: String): SpanBuilder
Creates a new SpanBuilder for a Producer Span and applies the provided component name as a metric tag.
Creates a new SpanBuilder for a Producer Span and applies the provided component name as a metric tag. It is recommended that all Spans include a "component" metric tag that indicates what library or library section is generating the Span.
- Definition Classes
- Tracing
- def rangeSampler(name: String, description: String, settings: ForDistributionInstrument): RangeSampler
Creates or retrieves a RangeSampler-backed metric with the provided settings
Creates or retrieves a RangeSampler-backed metric with the provided settings
- Definition Classes
- MetricBuilding
- def rangeSampler(name: String, description: String, unit: MeasurementUnit, dynamicRange: DynamicRange): RangeSampler
Creates or retrieves a RangeSampler-backed metric with the provided unit and dynamic range
Creates or retrieves a RangeSampler-backed metric with the provided unit and dynamic range
- Definition Classes
- MetricBuilding
- def rangeSampler(name: String, unit: MeasurementUnit, dynamicRange: DynamicRange): RangeSampler
Creates or retrieves a RangeSampler-backed metric with the provided unit and dynamic range
Creates or retrieves a RangeSampler-backed metric with the provided unit and dynamic range
- Definition Classes
- MetricBuilding
- def rangeSampler(name: String, description: String, unit: MeasurementUnit, autoUpdateInterval: Duration): RangeSampler
Creates or retrieves a RangeSampler-backed metric with the provided unit and auto-update interval
Creates or retrieves a RangeSampler-backed metric with the provided unit and auto-update interval
- Definition Classes
- MetricBuilding
- def rangeSampler(name: String, description: String, unit: MeasurementUnit): RangeSampler
Creates or retrieves a RangeSampler-backed metric with the provided unit
Creates or retrieves a RangeSampler-backed metric with the provided unit
- Definition Classes
- MetricBuilding
- def rangeSampler(name: String, unit: MeasurementUnit, autoUpdateInterval: Duration): RangeSampler
Creates or retrieves a RangeSampler-backed metric with the provided unit and auto-update interval
Creates or retrieves a RangeSampler-backed metric with the provided unit and auto-update interval
- Definition Classes
- MetricBuilding
- def rangeSampler(name: String, unit: MeasurementUnit): RangeSampler
Creates or retrieves a RangeSampler-backed metric with the provided unit
Creates or retrieves a RangeSampler-backed metric with the provided unit
- Definition Classes
- MetricBuilding
- def rangeSampler(name: String, description: String): RangeSampler
Creates or retrieves a RangeSampler-backed metric
Creates or retrieves a RangeSampler-backed metric
- Definition Classes
- MetricBuilding
- def rangeSampler(name: String): RangeSampler
Creates or retrieves a RangeSampler-backed metric
Creates or retrieves a RangeSampler-backed metric
- Definition Classes
- MetricBuilding
- def reconfigure(newConfig: Config): Unit
Supply a new Config instance to rule Kamon's world.
Supply a new Config instance to rule Kamon's world.
- Definition Classes
- Configuration
- def registry(): MetricRegistry
Metric registry from which all metric-building APIs will draw instances.
Metric registry from which all metric-building APIs will draw instances. For more details on the entire set of exposes APIs please refer to kamon.metric.MetricBuilding.
- Attributes
- protected
- Definition Classes
- Metrics → MetricBuilding
- def runWithContext[T](context: Context)(f: => T): T
Temporarily stores the provided Context on Kamon's Context Storage.
Temporarily stores the provided Context on Kamon's Context Storage. The provided Context will be stored before executing the provided function and removed right after it finishes executing.
- Definition Classes
- ContextStorage
- Annotations
- @inline()
- def runWithContextEntry[T, K](key: Key[K], value: K)(f: => T): T
Temporarily stores the provided Context Key on Kamon's Context Storage.
Temporarily stores the provided Context Key on Kamon's Context Storage. The provided Context key will be added to the current Context and stored before executing the provided function, then removed right after execution finishes.
- Definition Classes
- ContextStorage
- def runWithContextTag[T](key: String, value: Long)(f: => T): T
Temporarily stores the provided Context tag on Kamon's Context Storage.
Temporarily stores the provided Context tag on Kamon's Context Storage. The provided Context tag will be added to the current Context and stored before executing the provided function, then removed right after execution finishes.
- Definition Classes
- ContextStorage
- def runWithContextTag[T](key: String, value: Boolean)(f: => T): T
Temporarily stores the provided Context tag on Kamon's Context Storage.
Temporarily stores the provided Context tag on Kamon's Context Storage. The provided Context tag will be added to the current Context and stored before executing the provided function, then removed right after execution finishes.
- Definition Classes
- ContextStorage
- def runWithContextTag[T](key: String, value: String)(f: => T): T
Temporarily stores the provided Context tag on Kamon's Context Storage.
Temporarily stores the provided Context tag on Kamon's Context Storage. The provided Context tag will be added to the current Context and stored before executing the provided function, then removed right after execution finishes.
- Definition Classes
- ContextStorage
- def runWithSpan[T](span: Span, finishSpan: Boolean)(f: => T): T
Temporarily stores the provided Span on Kamon's Context Storage.
Temporarily stores the provided Span on Kamon's Context Storage. The provided Span will be added to the current Context and stored before executing the provided function, then removed right after execution finishes. Optionally, this function can finish the provided Span once the function execution finishes.
- Definition Classes
- ContextStorage
- Annotations
- @inline()
- def runWithSpan[T](span: Span)(f: => T): T
Temporarily stores the provided Span on Kamon's Context Storage.
Temporarily stores the provided Span on Kamon's Context Storage. The provided Span will be added to the current Context and stored before executing the provided function, then removed right after execution finishes.
- Definition Classes
- ContextStorage
- def serverSpanBuilder(operationName: String, component: String): SpanBuilder
Creates a new SpanBuilder for a Server Span and applies the provided component name as a metric tag.
Creates a new SpanBuilder for a Server Span and applies the provided component name as a metric tag. It is recommended that all Spans include a "component" metric tag that indicates what library or library section is generating the Span.
- Definition Classes
- Tracing
- def shouldAttachInstrumentation(): Boolean
- Attributes
- protected
- Definition Classes
- Configuration
- def span[A](operationName: String, component: String)(f: => A): A
Creates an Internal Span that finishes automatically when the provided function finishes execution.
Creates an Internal Span that finishes automatically when the provided function finishes execution. If the provided function returns a scala.concurrent.Future or java.util.concurrent.CompletionStage implementation then the Span will be finished with the Future/CompletionState completes.
You can get access to the created Span within the provided function using Kamon.currentSpan. For example, if you wanted to add a tag to a Span created with this function you could do it as follows:
span("fetchUserDetails") { Kamon.currentSpan.tag("user.id", userId)
// Your business logic... }
If you need more customization options for the Span or complete control over Context propagation and Span lifecycle then create a SpanBuilder instead.
- Definition Classes
- Tracing
- def span[A](operationName: String)(f: => A): A
Creates an Internal Span that finishes automatically when the provided function finishes execution.
Creates an Internal Span that finishes automatically when the provided function finishes execution. If the provided function returns a scala.concurrent.Future or java.util.concurrent.CompletionStage implementation then the Span will be finished with the Future/CompletionState completes.
You can get access to the created Span within the provided function using Kamon.currentSpan. For example, if you wanted to add a tag to a Span created with this function you could do it as follows:
span("fetchUserDetails") { Kamon.currentSpan.tag("user.id", userId)
// Your business logic... }
If you need more customization options for the Span or complete control over Context propagation and Span lifecycle then create a SpanBuilder instead.
- Definition Classes
- Tracing
- def spanBuilder(operationName: String): SpanBuilder
Creates a new raw SpanBuilder instance using the provided operation name.
Creates a new raw SpanBuilder instance using the provided operation name.
- Definition Classes
- Tracing
- def status(): Status
Returns an accessor to Kamon's current status.
Returns an accessor to Kamon's current status. The current status information is split into four main sections:
- Settings: which include the Kamon version, environment and configuration being used.
- Module Registry: Lists all modules that have been detected on the classpath and their current state.
- Metric Registry: Lists all metrics currently registered in Kamon and all instruments belonging to them.
- Instrumentation: Lists all instrumentation modules that have been detected and their current state.
All information exposed by the Status API represents an immutable snapshot of the state at the moment the status was requested.
- Definition Classes
- CurrentStatus
- def stop(): Future[Unit]
- Definition Classes
- Init
- def stopModules(): Future[Unit]
Stops all registered modules and returns a future that completes when the stop callback on all available modules have been completed.
Stops all registered modules and returns a future that completes when the stop callback on all available modules have been completed. This includes automatically and programmatically registered modules.
- Definition Classes
- ModuleManagement
- def storeContext(context: Context): Scope
Stores the provided Context on Kamon's Context Storage and returns a Scope that removes that Context from the it upon closing.
Stores the provided Context on Kamon's Context Storage and returns a Scope that removes that Context from the it upon closing. When a Scope is closed, it will always set the current Context to the Context that was available right before it was created.
NOTE: The default implementation of Scope is not thread safe and, unless there is a good reason not to, users should always close scopes before leaving a thread, otherwise there is a risk of leaving "dirty" threads that could cause unexpected correlation between Contexts from different operations. It is strongly recommended to use any of the .storeContext(...) variants which ensure closing Scopes after finishing execution.
- Definition Classes
- ContextStorage
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def timer(name: String, description: String, dynamicRange: DynamicRange): Timer
Creates or retrieves a Timer-backed metric with the provided unit and dynamic range
Creates or retrieves a Timer-backed metric with the provided unit and dynamic range
- Definition Classes
- MetricBuilding
- def timer(name: String, dynamicRange: DynamicRange): Timer
Creates or retrieves a Timer-backed metric with the provided unit and dynamic range
Creates or retrieves a Timer-backed metric with the provided unit and dynamic range
- Definition Classes
- MetricBuilding
- def timer(name: String, description: String): Timer
Creates or retrieves a Timer-backed metric
Creates or retrieves a Timer-backed metric
- Definition Classes
- MetricBuilding
- def timer(name: String): Timer
Creates or retrieves a Timer-backed metric
Creates or retrieves a Timer-backed metric
- Definition Classes
- MetricBuilding
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tracer(): Tracer
The Tracer instance is only exposed to other Kamon components that need it like the Module Registry and Status
The Tracer instance is only exposed to other Kamon components that need it like the Module Registry and Status
- Attributes
- protected
- Definition Classes
- Tracing
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def registerModule(name: String, description: String, module: Module, configPath: String): Registration
Register a module instantiated by the user and returns a Registration that can be used to stop and deregister the module at any time.
Register a module instantiated by the user and returns a Registration that can be used to stop and deregister the module at any time.
- Definition Classes
- ModuleManagement
- Annotations
- @deprecated
- Deprecated
(Since version 2.3.0) Use addReporter or addScheduledAction instead
- def registerModule(name: String, module: Module): Registration
Register a module instantiated by the user and returns a Registration that can be used to stop and deregister the module at any time.
Register a module instantiated by the user and returns a Registration that can be used to stop and deregister the module at any time.
- Definition Classes
- ModuleManagement
- Annotations
- @deprecated
- Deprecated
(Since version 2.3.0) Use addReporter or addScheduledAction instead