% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api.R
\name{get_active_span}
\alias{get_active_span}
\title{Returns the active span, if any}
\usage{
get_active_span()
}
\value{
The active span, an \link{otel_span} object, if any, or an invalid
span if there is no active span.
}
\description{
This is sometimes useful, to add additional attributes or links to the
currently active span.
}
\examples{
fun <- function() {
  otel::start_local_active_span("fun")
  spn <- otel::get_active_span()
  spn$set_attribute("key", "attribute-value")
}
fun()
}
