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
- Alphabetic
- By Inheritance
- Telemetry
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- 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.
- 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
- 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.
- 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.
- 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).
- 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).
Concrete 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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])