ExecutorInstrumentation

kamon.instrumentation.executor.ExecutorInstrumentation

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Abstracts the means of reading some telemetry information from concrete executor implementations. This allows us to track the same metrics even when coming from slightly different implementations. The three cases we have seen so far where this is useful are when instrumenting: the ForkJoinPool included in the JDK (since Java 8), the one included in Scala 2.11 Library and the one shipped with Akka.

Abstracts the means of reading some telemetry information from concrete executor implementations. This allows us to track the same metrics even when coming from slightly different implementations. The three cases we have seen so far where this is useful are when instrumenting: the ForkJoinPool included in the JDK (since Java 8), the one included in Scala 2.11 Library and the one shipped with Akka.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
class InstrumentedExecutionContext(ec: ExecutionContext, val underlyingExecutor: Option[ExecutorService]) extends ExecutionContext

Wraps an Execution Context and its underlying ExecutorService, if known. The only purpose of wrapping is to to provide a shutdown method that can be used to clear shutdown the underlying ExecutorService and remove all the metrics related to it.

Wraps an Execution Context and its underlying ExecutorService, if known. The only purpose of wrapping is to to provide a shutdown method that can be used to clear shutdown the underlying ExecutorService and remove all the metrics related to it.

Attributes

Supertypes
trait ExecutionContext
class Object
trait Matchable
class Any
class InstrumentedForkJoinPool(wrapped: ExecutorService, telemetryReader: ForkJoinPoolTelemetryReader, name: String, extraTags: TagSet, scheduledActionName: String, settings: Settings) extends ExecutorService

Executor service wrapper for ForkJoin Pool executors that keeps track of submitted and completed tasks and optionally tracks the time tasks spend waiting on the underlying executor service's queue. This instrumented executor does some extra counting work (compared to the InstrumentedThreadPool class) because ForkJoin Pool executors do not provide submitted and completed task counters.

Executor service wrapper for ForkJoin Pool executors that keeps track of submitted and completed tasks and optionally tracks the time tasks spend waiting on the underlying executor service's queue. This instrumented executor does some extra counting work (compared to the InstrumentedThreadPool class) because ForkJoin Pool executors do not provide submitted and completed task counters.

The instruments used to track the pool's behavior are removed once the pool is shut down.

Attributes

Supertypes
trait ExecutorService
trait Executor
class Object
trait Matchable
class Any
class InstrumentedScheduledThreadPoolExecutor(wrapped: ScheduledThreadPoolExecutor, name: String, extraTags: TagSet, scheduledActionName: String) extends InstrumentedThreadPool, ScheduledExecutorService

Executor service wrapper for ScheduledThreadPool executors that keeps track of submitted and completed tasks. Since tasks submitted to this type of executor are expected to be delayed for some time we are not explicitly tracking the time-in-queue metric, nor allowing to perform context propagation (at least manually).

Executor service wrapper for ScheduledThreadPool executors that keeps track of submitted and completed tasks. Since tasks submitted to this type of executor are expected to be delayed for some time we are not explicitly tracking the time-in-queue metric, nor allowing to perform context propagation (at least manually).

The instruments used to track the pool's behavior are removed once the pool is shut down.

Attributes

Supertypes
trait ScheduledExecutorService
trait ExecutorService
trait Executor
class Object
trait Matchable
class Any
Show all
class InstrumentedThreadPool(wrapped: ThreadPoolExecutor, name: String, extraTags: TagSet, scheduledActionName: String, settings: Settings) extends ExecutorService

Executor service wrapper for ThreadPool executors that keeps track of submitted and completed tasks and optionally tracks the time tasks spend waiting on the underlying executor service's queue.

Executor service wrapper for ThreadPool executors that keeps track of submitted and completed tasks and optionally tracks the time tasks spend waiting on the underlying executor service's queue.

The instruments used to track the pool's behavior are removed once the pool is shut down.

Attributes

Supertypes
trait ExecutorService
trait Executor
class Object
trait Matchable
class Any
Known subtypes
class Settings(val shouldTrackTimeInQueue: Boolean, val shouldPropagateContextOnSubmit: Boolean)

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def instrument(executor: ExecutorService, name: String): ExecutorService

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala). All metrics related to the instrumented service will have the following tags:

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala). All metrics related to the instrumented service will have the following tags:

  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrument(executor: ExecutorService, name: String, settings: Settings): ExecutorService

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

All metrics related to the instrumented service will have the following tags:

  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrument(executor: ExecutorService, name: String, extraTags: TagSet): ExecutorService

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala). All metrics related to the instrumented service will have the following tags:

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala). All metrics related to the instrumented service will have the following tags:

  • all of the provided extraTags (take into account that any "name" or "type" tags will be overwritten.
  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrument(executor: ExecutorService, name: String, extraTags: TagSet, settings: Settings): ExecutorService

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

All metrics related to the instrumented service will have the following tags:

  • all of the provided extraTags (take into account that any "name" or "type" tags will be overwritten.
  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrument(executor: ExecutorService, name: String, extraTags: TagSet, scheduledActionName: String, settings: Settings): ExecutorService

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

All metrics related to the instrumented service will have the following tags:

  • all of the provided extraTags (take into account that any "name" or "type" tags will be overwritten.
  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrument(executor: ExecutorService, telemetryReader: ForkJoinPoolTelemetryReader, name: String, extraTags: TagSet, scheduledActionName: String, settings: Settings): ExecutorService

Creates a new instrumented ExecutorService that wraps the provided one, assuming that the wrapped executor is a form of ForkJoinPool implementation. The instrumented executor will track all the common pool metrics and optionally, track the time spent by each task on the wrapped executor's queue.

Creates a new instrumented ExecutorService that wraps the provided one, assuming that the wrapped executor is a form of ForkJoinPool implementation. The instrumented executor will track all the common pool metrics and optionally, track the time spent by each task on the wrapped executor's queue.

All metrics related to the instrumented service will have the following tags:

  • all of the provided extraTags (take into account that any "name" or "type" tags will be overwritten.
  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrumentExecutionContext(executionContext: ExecutionContext, name: String): InstrumentedExecutionContext

Creates a new instrumented ExecutionContext that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala). All metrics related to the instrumented service will have the following tags:

Creates a new instrumented ExecutionContext that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala). All metrics related to the instrumented service will have the following tags:

  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrumentExecutionContext(executionContext: ExecutionContext, name: String, settings: Settings): InstrumentedExecutionContext

Creates a new instrumented ExecutionContext that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

Creates a new instrumented ExecutionContext that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

All metrics related to the instrumented service will have the following tags:

  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrumentExecutionContext(executionContext: ExecutionContext, name: String, extraTags: TagSet): InstrumentedExecutionContext

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala). All metrics related to the instrumented service will have the following tags:

Creates a new instrumented ExecutorService that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala). All metrics related to the instrumented service will have the following tags:

  • all of the provided extraTags (take into account that any "name" or "type" tags will be overwritten.
  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrumentExecutionContext(executionContext: ExecutionContext, name: String, extraTags: TagSet, scheduledActionName: String, settings: Settings): InstrumentedExecutionContext

Creates a new instrumented ExecutionContext that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

Creates a new instrumented ExecutionContext that wraps the provided one. The instrumented executor will track metrics for ThreadPoolExecutor and ForkJoinPool instances (both from Java and Scala) and optionally, track the time spent by each task on the wrapped executor's queue.

All metrics related to the instrumented service will have the following tags:

  • all of the provided extraTags (take into account that any "name" or "type" tags will be overwritten.
  • name: set to the provided name parameter.
  • type: set to "ThreadPoolExecutor" executors or "ForkJoinPool".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrumentScheduledExecutor(executor: ScheduledExecutorService, name: String): ScheduledExecutorService

Creates a new instrumented ScheduledExecutorService that wraps the provided one. The instrumented executor will track metrics for a ScheduledThreadPoolExecutor, but will not perform any context propagation nor track the time in queue metric for submitted tasks.

Creates a new instrumented ScheduledExecutorService that wraps the provided one. The instrumented executor will track metrics for a ScheduledThreadPoolExecutor, but will not perform any context propagation nor track the time in queue metric for submitted tasks.

All metrics related to the instrumented service will have the following tags:

  • name: set to the provided name parameter.
  • type: set to "ScheduledThreadPoolExecutor".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrumentScheduledExecutor(executor: ScheduledExecutorService, name: String, extraTags: TagSet): ScheduledExecutorService

Creates a new instrumented ScheduledExecutorService that wraps the provided one. The instrumented executor will track metrics for a ScheduledThreadPoolExecutor, but will not perform any context propagation nor track the time in queue metric for submitted tasks.

Creates a new instrumented ScheduledExecutorService that wraps the provided one. The instrumented executor will track metrics for a ScheduledThreadPoolExecutor, but will not perform any context propagation nor track the time in queue metric for submitted tasks.

All metrics related to the instrumented service will have the following tags:

  • all of the provided extraTags (take into account that any "name" or "type" tags will be overwritten.
  • name: set to the provided name parameter.
  • type: set to "ScheduledThreadPoolExecutor".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

def instrumentScheduledExecutor(executor: ScheduledExecutorService, name: String, extraTags: TagSet, scheduledActionName: String): ScheduledExecutorService

Creates a new instrumented ScheduledExecutorService that wraps the provided one. The instrumented executor will track metrics for a ScheduledThreadPoolExecutor, but will not perform any context propagation nor track the time in queue metric for submitted tasks.

Creates a new instrumented ScheduledExecutorService that wraps the provided one. The instrumented executor will track metrics for a ScheduledThreadPoolExecutor, but will not perform any context propagation nor track the time in queue metric for submitted tasks.

All metrics related to the instrumented service will have the following tags:

  • all of the provided extraTags (take into account that any "name" or "type" tags will be overwritten.
  • name: set to the provided name parameter.
  • type: set to "ScheduledThreadPoolExecutor".

Once the returned executor is shutdown, all related metric instruments will be removed.

Attributes

Concrete fields

We do not perform context propagation on submit by default because the automatic instrumentation provided by this module should ensure that all interesting Runnable/Callable implementations capture a Context instance. Furthermore, in many situations the current Context when a Runnable/Callable is created is different from the current context when it is submitted for execution and in most situations it is safer to assume that all Runnable/Callable should capture the current Context at the instant when they are created, not when submitted.

We do not perform context propagation on submit by default because the automatic instrumentation provided by this module should ensure that all interesting Runnable/Callable implementations capture a Context instance. Furthermore, in many situations the current Context when a Runnable/Callable is created is different from the current context when it is submitted for execution and in most situations it is safer to assume that all Runnable/Callable should capture the current Context at the instant when they are created, not when submitted.

Attributes

Settings that do not enable any extra features on the instrumented executor service.

Settings that do not enable any extra features on the instrumented executor service.

Attributes