Membrane.TelemetryMetrics.Reporter (Membrane Telemetry Metrics v0.1.2)

View Source

Attaches handlers to :telemetry events based on the received list of metrics definitions. The attached handlers store metrics values in ETS tables. These values can be gotten by calling scrape/2 function or also reset by calling scrape_and_cleanup/2.

Currently supported types of metrics are:

Currently supported fields of metrics definitions are: :name, :event_name, measurement. Fields :keep, :reporter_options, tag_values, tags, :unit and functionalities related to them are not supported yet. Metrics values are grouped by label.

Summary

Types

report()

@type report() :: map()

reporter()

@type reporter() :: pid() | atom()

Functions

child_spec(init_arg)

@spec child_spec(Keyword.t()) :: Supervisor.child_spec()

Returns a specification to start this module under a supervisor.

See Supervisor.

scrape(reporter, timeout \\ 5000)

@spec scrape(reporter(), non_neg_integer()) :: report()

scrape_and_cleanup(reporter, timeout \\ 5000)

@spec scrape_and_cleanup(reporter(), non_neg_integer()) :: report()

start_link(init_arg, options \\ [])

stop(reporter)

@spec stop(reporter()) :: :ok