Get a meter from the default meter provider
get_meter(
name = NULL,
version = NULL,
schema_url = NULL,
attributes = NULL,
...,
provider = NULL
)Name of the new tracer. If missing, then deduced automatically.
Optional. Specifies the version of the instrumentation
scope if the scope has a version (e.g. R package version).
Example value: "1.0.0".
Optional. Specifies the Schema URL that should be recorded in the emitted telemetry.
Optional. Specifies the instrumentation scope attributes to associate with emitted telemetry.
Additional arguments are passed to the get_meter()
method of the provider.
Meter provider to use. If NULL, then it uses
get_default_meter_provider() to get a tracer provider.
An otel_meter object.
Other low level metrics API:
get_default_meter_provider(),
meter_provider_noop,
otel_counter,
otel_gauge,
otel_histogram,
otel_meter,
otel_meter_provider,
otel_up_down_counter
myfun <- function() {
mtr <- otel::get_meter()
ctr <- mtr$create_counter("session-count")
ctr$add(1)
}
myfun()