Learn R Programming

otel (version 0.2.0)

get_active_span: Returns the active span, if any

Description

This is sometimes useful, to add additional attributes or links to the currently active span.

Usage

get_active_span()

Arguments

Value

The active span, an otel_span object, if any, or an invalid span if there is no active span.

Examples

Run this code
fun <- function() {
  otel::start_local_active_span("fun")
  spn <- otel::get_active_span()
  spn$set_attribute("key", "attribute-value")
}
fun()

Run the code above in your browser using DataLab