Adds a traceparent header to an existing set of HTTP headers using
the current active trace and span context.
Usage
inject_headers(headers = list())Arguments
- headers
A named list of HTTP headers. Default
list().
Examples
# Inside an active trace and span
with_trace("http-call", {
with_span("request", type = "tool", {
headers <- inject_headers(list("Content-Type" = "application/json"))
headers$traceparent
})
})
#> [1] "00-b88c9ae35eb1e9ed1991423dd1445207-7d57df21eebfba76-01"