Recipe.Telemetry behaviour (recipe v0.5.0)

View Source

The Recipe.Telemetry behaviour can be used to define a module capable of handling events emitted by a recipe run.

Each callback is invoked at different step of a recipe run, receiving data about the current step and its execution time.

Please refer to the docs for Recipe.run/3 to see how to enable debug and telemetry information.

Summary

Callbacks

Invoked after failing to execute a step.

Invoked at the end of a recipe execution, irrespectively of the success or failure of the last executed step.

Invoked at the start of a recipe execution.

Invoked after successfully executing a step.

Types

elapsed_microseconds()

@type elapsed_microseconds() :: integer()

Callbacks

on_error(step, term, t, elapsed_microseconds)

@callback on_error(Recipe.step(), term(), Recipe.t(), elapsed_microseconds()) :: :ok

Invoked after failing to execute a step.

on_finish(t)

@callback on_finish(Recipe.t()) :: :ok

Invoked at the end of a recipe execution, irrespectively of the success or failure of the last executed step.

on_start(t)

@callback on_start(Recipe.t()) :: :ok

Invoked at the start of a recipe execution.

on_success(step, t, elapsed_microseconds)

@callback on_success(Recipe.step(), Recipe.t(), elapsed_microseconds()) :: :ok

Invoked after successfully executing a step.