[][src]Trait nakadion::instrumentation::Instruments

pub trait Instruments {
    fn consumer_started(&self) { ... }
fn consumer_stopped(&self, _ran_for: Duration) { ... }
fn streaming_ended(&self, _streamed_for: Duration) { ... }
fn stream_connect_attempt_success(&self, _time: Duration) { ... }
fn stream_connect_attempt_failed(&self, _time: Duration) { ... }
fn stream_connected(&self, _time: Duration) { ... }
fn stream_not_connected(&self, _time: Duration, _err: &ConnectError) { ... }
fn stream_chunk_received(&self, _n_bytes: usize) { ... }
fn stream_frame_completed(&self, _n_bytes: usize, _time: Duration) { ... }
fn stream_tick_emitted(&self) { ... }
fn info_frame_received(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant
    ) { ... }
fn keep_alive_frame_received(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant
    ) { ... }
fn batch_frame_received(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant,
        _events_bytes: usize
    ) { ... }
fn batch_frame_gap(&self, _gap: Duration) { ... }
fn no_frames_warning(&self, _no_frames_for: Duration) { ... }
fn no_events_warning(&self, _no_events_for: Duration) { ... }
fn stream_dead(&self, _after: Duration) { ... }
fn stream_error(&self, _err: &EventStreamError) { ... }
fn stream_unconsumed_events(&self, _n_unconsumed: usize) { ... }
fn batches_in_flight_incoming(&self, _stats: &EventStreamBatchStats) { ... }
fn batches_in_flight_processed(&self, _stats: &EventStreamBatchStats) { ... }
fn in_flight_stats_reset(&self) { ... }
fn event_type_partition_activated(&self) { ... }
fn event_type_partition_deactivated(&self, _active_for: Duration) { ... }
fn batch_processing_started(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant
    ) { ... }
fn batch_processed(&self, _n_bytes: usize, _time: Duration) { ... }
fn batch_processed_n_events(&self, _n_events: usize) { ... }
fn batch_deserialized(&self, _n_bytes: usize, _time: Duration) { ... }
fn cursor_to_commit_received(
        &self,
        _frame_started_at: Instant,
        _frame_completed_at: Instant
    ) { ... }
fn cursors_commit_triggered(&self, _trigger: CommitTrigger) { ... }
fn cursor_ages_on_commit_attempt(
        &self,
        _first_cursor_age: Duration,
        _last_cursor_age: Duration,
        _first_cursor_age_warning: bool
    ) { ... }
fn cursors_committed(&self, _n_cursors: usize, _time: Duration) { ... }
fn batches_committed(&self, _n_batches: usize, _n_events: usize) { ... }
fn cursors_not_committed(
        &self,
        _n_cursors: usize,
        _time: Duration,
        _err: &CommitError
    ) { ... }
fn commit_cursors_attempt_failed(&self, _n_cursors: usize, _time: Duration) { ... }
fn stream_parameters(&self, _params: &StreamParameters) { ... } }

An interface on which Nakadion exposes metrics

An implementor of this interface can be used with Instrumentation::new

Implementations of this trait should not be shared with multiple consumers since they are stateful e.g. in flight batches.

Provided methods

fn consumer_started(&self)

fn consumer_stopped(&self, _ran_for: Duration)

fn streaming_ended(&self, _streamed_for: Duration)

fn stream_connect_attempt_success(&self, _time: Duration)

Triggered when a single connect attempt for a stream was successful

time is the time for the request

fn stream_connect_attempt_failed(&self, _time: Duration)

Triggered when a single connect attempt for a stream failed

time is the time for the request

fn stream_connected(&self, _time: Duration)

Triggered when a stream was finally connect after maybe multiple attempts

time is the time for the whole cycle until a connection was made

fn stream_not_connected(&self, _time: Duration, _err: &ConnectError)

Triggered when connecting to a stream finally failed after maybe multiple attempts

time is the time for the whole cycle until a connection attempts finally failed

fn stream_chunk_received(&self, _n_bytes: usize)

A chunk of data with n_bytes was received over the network

fn stream_frame_completed(&self, _n_bytes: usize, _time: Duration)

Chunks have been assembled to a complete frame containing all required data

fn stream_tick_emitted(&self)

An internal tick signal has been emitted

fn info_frame_received(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant
)

The controller received a frame which contained info data

The time it took from receiving the first chunk until it reached the controller are passed along with the complete bytes of the frame

fn keep_alive_frame_received(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant
)

The controller received a frame which contained no events

The time it took from receiving the first chunk until it reached the controller are passed along with the complete bytes of the frame

fn batch_frame_received(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant,
    _events_bytes: usize
)

A partition which was formerly not known to be active was sent data on The controller received a frame which contained events

The time it took from receiving the first chunk until it reached the controller are passed along with the complete bytes of the frame

fn batch_frame_gap(&self, _gap: Duration)

The time elapsed between the reception of 2 batches with events

fn no_frames_warning(&self, _no_frames_for: Duration)

No frames have been received for the given time and the warning has already threshold elapsed

fn no_events_warning(&self, _no_events_for: Duration)

No events have been received for the given time and the warning threshold has already elapsed

fn stream_dead(&self, _after: Duration)

fn stream_error(&self, _err: &EventStreamError)

The stream was aborted due to a streaming related error

fn stream_unconsumed_events(&self, _n_unconsumed: usize)

Tracks the number of unconsumed events.

Only available if the Consumer was created with a clients that supports the SubscriptionApi

fn batches_in_flight_incoming(&self, _stats: &EventStreamBatchStats)

Triggered when a new batch with events was received

fn batches_in_flight_processed(&self, _stats: &EventStreamBatchStats)

Triggered when a batch with events was processed

fn in_flight_stats_reset(&self)

Usually triggered when there are still batches in flight and the stream aborts.

This is a correction for the inflight metrics and uncommitted events metrics

fn event_type_partition_activated(&self)

fn event_type_partition_deactivated(&self, _active_for: Duration)

A partition did not receive data for some time is is therefore considered inactive.

fn batch_processing_started(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant
)

fn batch_processed(&self, _n_bytes: usize, _time: Duration)

Events were processed.

fn batch_processed_n_events(&self, _n_events: usize)

Events were processed.

fn batch_deserialized(&self, _n_bytes: usize, _time: Duration)

Events have been deserialized.

The amount of bytes deserialized and the time it took are passed.

fn cursor_to_commit_received(
    &self,
    _frame_started_at: Instant,
    _frame_completed_at: Instant
)

Cursors to be committed have reached the commit stage.

The time it took from receiving the first chunk until it reached the commit stage are passed

fn cursors_commit_triggered(&self, _trigger: CommitTrigger)

Cursors commit was triggered.

fn cursor_ages_on_commit_attempt(
    &self,
    _first_cursor_age: Duration,
    _last_cursor_age: Duration,
    _first_cursor_age_warning: bool
)

Ages of the cursors when making a commit attempt to Nakadi

This ages are measured before making an attempt to make a call to Nakadi. first_cursor_age is the critical age of the first cursor which might be commited with a later cursor which has the age last_cursor_age.

`` should be true, when the first cursor reached a critical age which might endanger or even cause the commit to fail.

fn cursors_committed(&self, _n_cursors: usize, _time: Duration)

Cursors were successfully committed.

The time request took is passed. A call to this method must not influence the uncommitted batches stats. Use batches_committed instead.

fn batches_committed(&self, _n_batches: usize, _n_events: usize)

Tracks what has been committed to track uncommitted batches and their events.

Collected values should be reset by in_flight_stats_reset

fn cursors_not_committed(
    &self,
    _n_cursors: usize,
    _time: Duration,
    _err: &CommitError
)

Cursors were not successfully committed.

The time request took is passed

fn commit_cursors_attempt_failed(&self, _n_cursors: usize, _time: Duration)

An attempt to commit cursors failed. There might still be a retry

The time request took is passed

fn stream_parameters(&self, _params: &StreamParameters)

Can be used to transmit limits and values via metrics

This function s not called at high frequency

Loading content...

Implementors

impl Instruments for Metrix[src]

impl Instruments for Instrumentation[src]

Loading content...