Learn R Programming

otel (version 0.2.0)

otel_histogram: OpenTelemetry Histogram Object

Description

otel_meter_provider -> otel_meter -> otel_counter, otel_up_down_counter, otel_histogram, otel_gauge

Arguments

Value

Not applicable.

Methods

histogram$record()

Update the statistics with the specified amount.

Usage

histogram$record(value, attributes = NULL, span_context = NULL, ...)

Arguments

  • value: A numeric value to record.

  • attributes: Additional attributes to add.

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

Value

The histogram object itself, invisibly.

Details

Usually you do not need to deal with otel_histogram objects directly. histogram_record() automatically sets up a meter and creates a histogram instrument, as needed.

A histogram object is created by calling the create_histogram() method of an otel_meter_provider().

You can use the record() method to update the statistics with the specified amount.

In R histogram values are represented by doubles.

See Also

Other low level metrics API: get_default_meter_provider(), get_meter(), meter_provider_noop, otel_counter, otel_gauge, otel_meter, otel_meter_provider, otel_up_down_counter

Examples

Run this code
mp <- get_default_meter_provider()
mtr <- mp$get_meter()
hst <- mtr$create_histogram("response-time")
hst$record(1.123)

Run the code above in your browser using DataLab