otel_meter_provider -> otel_meter -> otel_counter, otel_up_down_counter, otel_histogram, otel_gauge
Details
Usually you do not need to deal with otel_up_down_counter objects directly.
up_down_counter_add() automatically sets up a meter and creates an
up-down counter instrument, as needed.
An up-down counter object is created by calling the
create_up_down_counter() method of an otel_meter_provider().
You can use the add() method to increment or decrement the counter.
In R up-down counters are represented by double values.
Methods
See also
Other low level metrics API:
get_default_meter_provider(),
get_meter(),
meter_provider_noop,
otel_counter,
otel_gauge,
otel_histogram,
otel_meter,
otel_meter_provider
Examples
mp <- get_default_meter_provider()
mtr <- mp$get_meter()
ctr <- mtr$create_up_down_counter("session")
ctr$add(1)