OpenTelemetry requests Instrumentation

This library allows tracing HTTP requests made by the requests library.

Usage

import requests
import opentelemetry.instrumentation.requests

# You can optionally pass a custom TracerProvider to
# RequestInstrumentor.instrument()
opentelemetry.instrumentation.requests.RequestsInstrumentor().instrument()
response = requests.get(url="https://www.example.org/")

API

class opentelemetry.instrumentation.requests.RequestsInstrumentor[source]

Bases: opentelemetry.instrumentation.instrumentor.BaseInstrumentor, opentelemetry.instrumentation.metric.MetricMixin

An instrumentor for requests See BaseInstrumentor

static uninstrument_session(session)[source]

Disables instrumentation on the session object.