Learn R Programming

otel (version 0.2.0)

gauge_record: Record a value of an OpenTelemetry gauge

Description

Record a value of an OpenTelemetry gauge

Usage

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

Value

The gauge object (otel_gauge), invisibly.

Arguments

name

Name of the gauge

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.

See Also

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

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

Examples

Run this code
otel::gauge_record("temperature", 27)

Run the code above in your browser using DataLab