open-telemetry / open-telemetry/opentelemetry-python-contrib

[opentelemetry-instrumentation-requests] Doesn't seem to instrument requests.Session

Open
#1,597 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

Describe your environment
Python 3.9.0
opentelemetry-instrumentation-requests 0.33b0
requests 2.28.2

Steps to reproduce

import requests
from requests.adapters import HTTPAdapter, Retry
from requests.exceptions import RetryError

session = requests.Session()
    retry = Retry(
        total=5,
        read=2,
        connect=2,
    )
    adapter = HTTPAdapter(max_retries=retry)
    session.mount("http://", adapter)

    session.get("https://pypi.org/project/opentelemetry-instrumentation-requests/")

What is the expected behavior?
Instrument successfully

What is the actual behavior?
Does not instrument successfully

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the opentelemetry-instrumentation-requests package and reproduce the report with a requests.Session configured with HTTPAdapter and Retry. Trace the session.get call and compare it with the instrumentation's supported request path. Done means the shown session request is instrumented successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.