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

opentelemetry-bootstrap -a install is unnecessarily slow — recommend piping to pip install in docs

Open Beginner friendly
#4,484 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What problem do you want to solve?

opentelemetry-bootstrap --action=install is very slow because it calls pip install -U --upgrade-strategy=only-if-needed <package> in a loop — once per discovered instrumentor (source).

For a typical project with ~8 instrumentors, this means:

  • 8 separate subprocess spawns (each ~0.5s Python startup overhead)
  • 8 separate pip loads (~1s each)
  • 8 separate dependency resolution passes with -U flag (checking PyPI for upgrades each time)
  • 8 separate pip check validations implicitly
    In my testing this takes 60–120 seconds in a Docker build.
Faster alternative

opentelemetry-bootstrap --action=requirements | pip install -r /dev/stdin

This is faster because:

  • 1 subprocess instead of 8
  • 1 pip startup instead of 8
  • 1 resolver pass that handles all packages together, instead of 8 independent passes
  • No -U flag — in a fresh environment (e.g., Docker build), there's nothing to upgrade, so the upgrade check is pure overhead
    In my testing this takes 15–25 seconds — a 4–6x speedup.
Relation to existing docs

The troubleshooting docs already recommend a similar pattern for uv:
uv run opentelemetry-bootstrap -a requirements | uv add --requirement -
But there's no equivalent recommendation for pip users. Since pip is still the default package manager for most Python users, it would be helpful to document this pattern as well.

Suggestions
  1. Add a "Bootstrap using pip" section in the troubleshooting docs alongside the existing "Bootstrap using uv" section, recommending:
    opentelemetry-bootstrap --action=requirements | pip install -r /dev/stdin
  2. Consider changing _run_install to batch all packages into a single pip install call instead of looping, which would make --action=install fast by default without requiring users to discover this workaround.
Environment

Python 3.14
opentelemetry-distro (latest)
Docker build context (fresh venv each time, no cache benefit from -U)

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 with the linked troubleshooting documentation and its existing “Bootstrap using uv” section, then inspect opentelemetry/instrumentation/bootstrap.py around _run_install. Add the equivalent pip recommendation and verify that the command and explanation match the reported behavior; batching installation is a separate optional consideration.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, performance
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.