Requests library instrumentor
The Instrumentor interface provides instrumentation libraries with the minimum requirements a library must provide to support auto-instrumentation. Implementors must provide an implementation for _instrument
and _uninstrument
, that's all. The instrumentation implementation details vary from one library to another depending on whether the library offers any event or callback mechanisms for instrumentation. In the case of the Requests library, the opentelemetry-instrumentation-requests
library relies on monkey patching the Session.request
and Session.send
methods from the requests
library. This instrumentation library does the following:
- Provides a wrapper method for the library calls that it instruments, and intercepts calls through those wrappers
- Upon invocation, creates a new span by calling the
start_as_current_span
method of the OpenTelemetry API, ensuring the span name follows semantic conventions - Injects the context information...