Collects metrics measurements in memory. This is useful for testing your instrumented R package or application.
with_otel_record()
uses this meter provider.
Use with_otel_record()
in your tests to record telemetry and check
that it is correct.
Value
meter_provider_memory$new()
returns an otel::otel_meter_provider
object. mp$get_metrics()
returns a named list of recorded metrics.
meter_provider_memory$options()
returns a named list, the current
values for all options.
Options
Memory exporter options
buffer_size
: buffer size, this is the maximum number of spans or metrics measurements that the provider can record. Must be positive. Value is set fromthe
opts
argument, orthe
OTEL_R_EXPORTER_MEMORY_METRICS_BUFFER_SIZE
environment variable, orthe
OTEL_R_EXPORTER_MEMORY_BUFFER_SIZE
environment variable, orthe default is
100
.
Metric reader options
export_interval
: the time interval between the start of two export attempts, in milliseconds. Value is set fromthe
opts
argument, orthe
OTEL_METRIC_EXPORT_INTERVAL
environment variable, orthe default is
60000
.
export_timeout
: Maximum allowed time to export data, in milliseconds. Value is set fromthe
opts
argument, orthe
OTEL_METRIC_EXPORT_TIMEOUT
environment variable, orthe default is
30000
.
Metric exporter options
aggregation_temporality
: possible values:"unspecified"
,"delta"
,"cumulative"
,"lowmemory"
. See the OpenTelemetry data model. Value is set fromthe
opts
argument, orthe
OTEL_R_EXPORTER_OTLP_AGGREGATION_TEMPORALITY
environment variable, orthe default is
"cumulative"
.