powered by
Increase an OpenTelemetry counter
counter_add(name, value = 1L, attributes = NULL, context = NULL, meter = NULL)
The counter object (otel_counter), invisibly.
Name of the counter.
Value to add to the counter, defaults to 1.
Additional attributes to add.
Span context. If missing the active context is used, if any.
Meter object (otel_meter). Otherwise it is passed to get_meter() to get a meter.
get_meter()
Other OpenTelemetry metrics instruments: gauge_record(), histogram_record(), up_down_counter_add()
gauge_record()
histogram_record()
up_down_counter_add()
Other OpenTelemetry metrics API: gauge_record(), histogram_record(), is_measuring_enabled(), up_down_counter_add()
is_measuring_enabled()
otel::counter_add("total-session-count", 1)
Run the code above in your browser using DataLab