% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api.R
\name{extract_http_context}
\alias{extract_http_context}
\title{Extract a span context from HTTP headers received from a client}
\usage{
extract_http_context(headers)
}
\arguments{
\item{headers}{A named list with one or two strings: \code{traceparent} is
mandatory, and \code{tracestate} is optional.}
}
\value{
And \link{otel_span_context} object.
}
\description{
The return value can be used as the \code{parent} option when starting
a span.
}
\examples{
hdr <- otel::pack_http_context()
ctx <- otel::extract_http_context()
ctx$is_valid()
}
\seealso{
\code{\link[=pack_http_context]{pack_http_context()}}
}
