otel_tracer_provider -> otel_tracer -> otel_span -> otel_span_context
Not applicable.
The tracer provider defines how traces are exported when collecting telemetry data. It is unlikely that you'd need to use tracer provider objects directly.
Usually there is a single tracer provider for an R app or script.
Typically the tracer provider is created automatically, at the first
start_local_active_span() or start_span() call. otel decides which
tracer provider class to use based on Environment Variables.
Note that this list is updated manually and may be incomplete.
tracer_provider_noop: No-op tracer provider, used when no traces are emitted.
otelsdk::tracer_provider_file: Save traces to a JSONL file.
otelsdk::tracer_provider_http: Send traces to a collector over HTTP/OTLP.
otelsdk::tracer_provider_memory: Collect emitted traces in memory. For testing.
otelsdk::tracer_provider_stdstream: Write traces to standard output or error or to a file. Primarily for debugging.
tracer_provider$get_tracer()Get or create a new tracer object.
tracer_provider$get_tracer(
name = NULL,
version = NULL,
schema_url = NULL,
attributes = NULL
)name: Tracer name, see get_tracer().
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. See as_attributes()
for allowed values. You can also use as_attributes() to convert R
objects to OpenTelemetry attributes.
Returns an OpenTelemetry tracer (otel_tracer) object.
Other low level trace API:
get_default_tracer_provider(),
get_tracer(),
otel_span,
otel_span_context,
otel_tracer,
tracer_provider_noop
tp <- otel::get_default_tracer_provider()
trc <- tp$get_tracer()
trc$is_enabled()
#> [1] FALSE