View Source Peep.Storage behaviour (peep v3.5.0)

Behaviour for Peep storage backends. These functions are mainly called by Peep during normal functioning. Ordinary usage of Peep should not require calling any of these functions.

Summary

Callbacks

Retrieves all stored metrics

Retrieves a single stored metric

Stores a sample metric

Creates a new term representing a Peep storage backend.

Removes metrics whose metadata contains a specific tag key and value. This is intended to improve situations where Peep emits metrics whose tags have high cardinality.

Calculates the amount of memory used by a Peep storage backend.

Callbacks

@callback get_all_metrics(term()) :: map()

Retrieves all stored metrics

Link to this callback

get_metric(term, t, map)

View Source
@callback get_metric(term(), Telemetry.Metrics.t(), map()) :: any()

Retrieves a single stored metric

Link to this callback

insert_metric(term, t, term, map)

View Source
@callback insert_metric(term(), Telemetry.Metrics.t(), term(), map()) :: any()

Stores a sample metric

@callback new() :: term()

Creates a new term representing a Peep storage backend.

@callback prune_tags(Enumerable.t(%{required(Telemetry.Metrics.tag()) => term()}), map()) ::
  :ok

Removes metrics whose metadata contains a specific tag key and value. This is intended to improve situations where Peep emits metrics whose tags have high cardinality.

@callback storage_size(term()) :: %{size: non_neg_integer(), memory: non_neg_integer()}

Calculates the amount of memory used by a Peep storage backend.