Module ot_observer

An Observer is a callback based instrument with a LastValue aggregator.

Description

On each collection cycle each Observer callback is run and passed an ObserverInstrument variable to use when observeing the new value, passing the ObserverInstrument, the new value and a list of attributes, key/value pairs.

Data Types

callback()


callback() = fun((observer_instrument()) -> ok)

observer_instrument()


observer_instrument() = term()

Function Index

observe/3
set_callback/3

Function Details

observe/3


observe(ObserverInstrument::observer_instrument(), Number::number(), LabelSet::ot_meter:label_set()) -> ok

set_callback/3


set_callback(Meter::opentelemetry:meter(), Observer::ot_meter:name(), Callback::callback()) -> ok