Peep.Storage behaviour (peep v4.2.0)
View SourceBehaviour 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
Retrieves all stored metrics
@callback get_metric(term(), Peep.metric_id(), Telemetry.Metrics.t(), map()) :: any()
Retrieves a single stored metric
@callback insert_metric(term(), Peep.metric_id(), 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.