View Source Beeline.HealthChecker.Logger (Beeline v1.0.0)
A Task to attach a logger exporter for health-checker telemetry
Attaches a telemetry handler which writes out how far a producer is behind the head of the stream to the logger.
This task can be started in a supervision tree such as an app's application supervision tree:
def start(_type, _args) do
children = [
Beeline.HealthChecker.Logger,
MyApp.MyBeelineTopology
]
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
end
The log messages are 'info' level in a format of the producer name
concatenated with "is caught up." if the producer's current stream position
matches the latest available stream position and a 'warn' level message
with "is behind: n events." when the producer is behind, with n
being
the number of events. The log messages also include metadata fields
:event_listener
- the name of the producer - and delta
: the number
of events by which the producer is behind.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Link to this section Functions
Returns a specification to start this module under a supervisor.
arg
is passed as the argument to Task.start_link/1
in the :start
field
of the spec.
For more information, see the Supervisor
module,
the Supervisor.child_spec/2
function and the Supervisor.child_spec/0
type.