Mobius (mobius v0.3.0) View Source

Localized metrics reporter

Link to this section Summary

Types

Arguments to Mobius

The name of the Mobius instance

Options to use when plotting time series metric data

Functions

Returns a specification to start this module under a supervisor.

Get the current metric information

Plot the metric name to the screen

Start Mobius

Link to this section Types

Specs

arg() ::
  {:name, name()}
  | {:metrics, [Telemetry.Metrics.t()]}
  | {:persistence_dir, binary()}

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 metric information
  • :day_count - number of day-granularity samples to keep
  • :hour_count - number of hour-granularity samples to keep
  • :minute_count - number of minute-granularity samples to keep
  • :second_count - number of second-granularity samples to keep

Specs

metric_name() :: [atom()]

Specs

metric_type() :: :counter | :last_value

Specs

name() :: atom()

The name of the Mobius instance

This is used to store data for a particular set of mobius metrics.

Specs

plot_opt() :: {:name, name()}

Options to use when plotting time series metric data

  • :name - the name of the Mobius instance you are using. Unless you specified this in your configuration you should be safe to allow this option to default, which is :mobius_metrics.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

info(name() | nil) :: :ok

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.

Link to this function

plot(metric_name, tags \\ %{}, opts \\ [])

View Source

Specs

plot(binary(), map(), [plot_opt()]) :: :ok

Plot the metric name to the screen

If there are tags for the metric you can pass those in the second argument:

Mobius.Charts.plot("vm.memory.total", %{some: :tag})

Start Mobius