Packages

trait Telemetry extends AnyRef

Service Provider Interface (SPI) for collecting metrics from projections.

Implementations must include a single constructor with two arguments: ProjectionId and ActorSystem. To setup your implementation, add a setting on your application.conf:

akka.projection.telemetry.implementations += com.example.MyMetrics
Annotations
@InternalStableApi()
Source
Telemetry.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Telemetry
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def afterProcess(externalContext: AnyRef): Unit

    Invoked after processing an event such that it is visible by the read-side threads (data is committed).

    Invoked after processing an event such that it is visible by the read-side threads (data is committed). This method is granted to be invoked after the envelope handler has committed but may or may not happen after the offset was committed (depending on the projection semantics).

    externalContext

    the context produced by Telemetry.beforeProcess and attached to the processed envelope.

  2. abstract def beforeProcess[Envelope](envelope: Envelope, creationTimeInMillis: Long): AnyRef

    Invoked as soon as the envelope is read, deserialised and ready to be processed.

    Invoked as soon as the envelope is read, deserialised and ready to be processed.

    envelope

    the envelope that's ready for processing. The type Envelope will always represent a single item as stored in the event log.

    creationTimeInMillis

    Timestamp (in millis-since-epoch) of the instant when the envelope was created. The meaning of "when the envelope was created" is implementation specific and could be an instant on the producer machine, or the instant when the database persisted the envelope, or other.

    returns

    an externally-provided context that will propagate with the envelope until Telemetry.afterProcess

  3. abstract def error(cause: Throwable): Unit

    Invoked when processing an envelope errors.

    Invoked when processing an envelope errors. When using a akka.projection.HandlerRecoveryStrategy that retries, this method will be invoked as many times as retries. If the error propagates and causes the projection to fail Telemetry.failed will be invoked.

    cause

    exception thrown by the errored envelope handler.

  4. abstract def failed(cause: Throwable): Unit

    Invoked when a projection processing an envelope fails (even after all retry attempts).

    Invoked when a projection processing an envelope fails (even after all retry attempts). The projection may then be restarted by a supervisor.

    cause

    exception thrown by the errored envelope handler.

  5. abstract def onOffsetStored(numberOfEnvelopes: Int): Unit

    Invoked when the offset is committed.

    Invoked when the offset is committed.

    numberOfEnvelopes

    number of envelopes marked as committed when committing this offset. This takes into consideration both batched processing (only commit one offset every N envelopes) and grouped handling (user code processes multiple envelopes at once).

  6. abstract def stopped(): Unit

    Invoked when a projection is stopped.

    Invoked when a projection is stopped. The reason for stopping is unspecified, can be a graceful stop or a failure (see Telemetry.failed).