Learn R Programming

otel (version 0.2.0)

up_down_counter_add: Increase or decrease an OpenTelemetry up-down counter

Description

Increase or decrease an OpenTelemetry up-down counter

Usage

up_down_counter_add(
  name,
  value = 1L,
  attributes = NULL,
  context = NULL,
  meter = NULL
)

Value

The up-down counter object (otel_up_down_counter), invisibly.

Arguments

name

Name of the up-down counter.

value

Value to add to or subtract from the counter, defaults to 1.

attributes

Additional attributes to add.

context

Span context. If missing the active context is used, if any.

meter

Meter object (otel_meter). Otherwise it is passed to get_meter() to get a meter.

See Also

Other OpenTelemetry metrics instruments: counter_add(), gauge_record(), histogram_record()

Other OpenTelemetry metrics API: counter_add(), gauge_record(), histogram_record(), is_measuring_enabled()

Examples

Run this code
otel::up_down_counter_add("session-count", 1)

Run the code above in your browser using DataLab