You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add basic Open Telemetry instrumentation for all requests.
This commit wraps all requests in an Open Telemetry span that abides by
the semantic conventions for HTTP clients [0] (insofar as I understand
them).
Right now this instrumentation is opt in: `otel` is in `Suggests`, and
tracing must be enabled (e.g. via the `OTEL_TRACES_EXPORTER` environment
variable). Otherwise this is costless at runtime.
For example:
library(otelsdk)
Sys.setenv(OTEL_TRACES_EXPORTER = "stderr")
request("https://google.com") |>
req_perform()
I'm not sure that `otel` needs to move to `Imports`, because by design
users actually need the `otelsdk` package to enable tracing anyway.
The major limitation right now is that we don't propagate the trace
context to the server [1], because `otel` doesn't have an explicit
mechanism for this yet.
[0]: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-client-span
[1]: https://www.w3.org/TR/trace-context/
Signed-off-by: Aaron Jacobs <[email protected]>
0 commit comments