Skip to content

Record a value of an OpenTelemetry histogram

Usage

histogram_record(name, value, attributes = NULL, context = NULL, meter = NULL)

Arguments

name

Name of the histogram.

value

Value to record.

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.

Value

The histogram object (otel_histogram), invisibly.

See also

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

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

Examples

otel::histogram_record("response-time", 0.2)