telemetry_instrument v0.1.0 Telemetry.Instrument
Convenience functions for creating telemetry events.
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
decrement(event, opts \\ [])
decrement(event_name(), by: integer(), tags: tags()) :: :ok
Decrement a value.
Examples
iex> Telemetry.Instrument.decrement("spaceship.engines.active")
:ok
iex> Telemetry.Instrument.decrement("spaceship.engines.active", by: 10)
:ok
iex> Telemetry.Instrument.decrement("spaceship.engines.active", tags: ["ready", "available"])
:ok
Link to this function
increment(event, opts \\ [])
increment(event_name(), by: integer(), tags: tags()) :: :ok
Increment a value.
Examples
iex> Telemetry.Instrument.increment("spaceship.engines.active")
:ok
iex> Telemetry.Instrument.increment("spaceship.engines.active", by: 10)
:ok
iex> Telemetry.Instrument.increment("spaceship.engines.active", tags: ["ready", "available"])
:ok
Link to this function
measure(event, fun, opts \\ [])
measure(event_name(), (... -> any()), [{:tags, tags()}]) :: :ok
Measures duration of function call.
Examples
iex> Telemetry.Instrument.measure("spaceship.lasers.fire", fn -> :pew_pew_pew end)
:pew_pew_pew
iex> Telemetry.Instrument.measure("spaceship.lasers.fire", fn -> :pew_pew_pew end, tags: ["ready", "available"])
:pew_pew_pew