View Source Mobius (mobius v0.4.0)
Localized metrics reporter
Link to this section Summary
Types
Arguments to Mobius
The name of the Mobius instance
A single metric data point
The name of the metric
Functions
Returns a specification to start this module under a supervisor.
Get the current metric information
Persist the metrics to disk
Start Mobius
Link to this section Types
Specs
arg() ::
{:mobius_instance, instance()}
| {:metrics, [Telemetry.Metrics.t()]}
| {:persistence_dir, binary()}
| {:database, Mobius.RRD.t()}
Arguments to Mobius
:name- the name of the mobius instance (defaults to:mobius):metrics- list of telemetry metrics for Mobius to track:persistence_dir- the top level directory where mobius will persist:autosave_interval- time in seconds between automatic writes of the persistence data (default disabled) metric information:database- theMobius.RRD.t()to use. This will default to the the default values found inMobius.RRD
Specs
instance() :: atom()
The name of the Mobius instance
This is used to store data for a particular set of mobius metrics.
Specs
metric() :: %{
type: metric_type(),
value: term(),
tags: map(),
timestamp: integer(),
name: binary()
}
A single metric data point
:type- the type of the metric:value- the value of the measurement for the metric:tags- a map of the tags for the metric:timestamp- the naive time in seconds the metric was sampled:name- the name of the metric
Specs
metric_name() :: binary()
The name of the metric
Example: "vm.memory.total"
Specs
metric_type() :: :counter | :last_value | :sum | :summary
Specs
time_unit() :: :second | :minute | :hour | :day
Specs
timestamp() :: integer()
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Get the current metric information
If you configured Mobius to use a different name then you can pass in your custom name to ensure Mobius requests the metrics from the right place.
Specs
info(instance() | nil) :: :ok
Persist the metrics to disk
Specs
Start Mobius