View Source Telemetria.Messenger behaviour (telemetria v0.22.0)

The helper allowing quick sending of the telemetry events to the messenger.

Summary

Types

The type of the message the messenger is to process and send

Callbacks

The actual implementation of the message sending (debug level)

The actual implementation of the message sending (error level)

The formatter of the incoming message, producing the binary to be sent over the wire

The actual implementation of the message sending (info level)

The actual implementation of the message sending (warning level)

Functions

Routes the message to the configured messenger(s)

Types

message()

@type message() :: %{required(atom()) => term()}

The type of the message the messenger is to process and send

Callbacks

debug(message, keyword)

@callback debug(
  message(),
  keyword()
) :: {:ok, term()} | {:error, term()}

The actual implementation of the message sending (debug level)

error(message, keyword)

@callback error(
  message(),
  keyword()
) :: {:ok, term()} | {:error, term()}

The actual implementation of the message sending (error level)

format(message, keyword)

(optional)
@callback format(
  message(),
  keyword()
) :: message() | String.t()

The formatter of the incoming message, producing the binary to be sent over the wire

info(message, keyword)

@callback info(
  message(),
  keyword()
) :: {:ok, term()} | {:error, term()}

The actual implementation of the message sending (info level)

warning(message, keyword)

@callback warning(
  message(),
  keyword()
) :: {:ok, term()} | {:error, term()}

The actual implementation of the message sending (warning level)

Functions

post(message, impl \\ Telemetria.Messenger.Logger, opts \\ [])

@spec post(message() | String.t(), impl :: atom() | module(), opts :: keyword()) ::
  {:ok, term()} | {:error, term()}

Routes the message to the configured messenger(s)