Learn R Programming

otel (version 0.2.0)

get_meter: Get a meter from the default meter provider

Description

Get a meter from the default meter provider

Usage

get_meter(
  name = NULL,
  version = NULL,
  schema_url = NULL,
  attributes = NULL,
  ...,
  provider = NULL
)

Value

An otel_meter object.

Arguments

name

Name of the new tracer. If missing, then deduced automatically.

version

Optional. Specifies the version of the instrumentation scope if the scope has a version (e.g. R package version). Example value: "1.0.0".

schema_url

Optional. Specifies the Schema URL that should be recorded in the emitted telemetry.

attributes

Optional. Specifies the instrumentation scope attributes to associate with emitted telemetry.

...

Additional arguments are passed to the get_meter() method of the provider.

provider

Meter provider to use. If NULL, then it uses get_default_meter_provider() to get a tracer provider.

See Also

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

Examples

Run this code
myfun <- function() {
  mtr <- otel::get_meter()
  ctr <- mtr$create_counter("session-count")
  ctr$add(1)
}
myfun()

Run the code above in your browser using DataLab