View Source Zexbox.Metrics (Zexbox v1.4.0)

This module is esponsible for setting up and supervising the metrics collection and telemetry. It attaches telemetry handlers for capturing metrics related to your Phoenix endpoints.

def start(_type, args) do
  children = [{Zexbox.Metrics, []}]
  Supervisor.start_link(children, opts)
end

Summary

Functions

Returns a specification to start this module under a supervisor.

Initializes the supervisor with the required child processes.

Starts the metrics supervisor and attaches the controller metrics.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init(args)

Initializes the supervisor with the required child processes.

Examples

iex> Zexbox.Metrics.init(nil)
{:ok,
 {%{intensity: 3, period: 5, strategy: :one_for_one, auto_shutdown: :never},
  [
    %{
      id: Zexbox.Metrics.Connection,
      start: {Instream.Connection.Supervisor, :start_link, [Zexbox.Metrics.Connection]}
    }
  ]}}

start_link(args)

@spec start_link(args :: any()) :: Supervisor.on_start()

Starts the metrics supervisor and attaches the controller metrics.

Examples

  iex> Zexbox.Metrics.start_link(nil)
  {:ok, #PID<0.123.0>}