open-telemetry / open-telemetry/opentelemetry-python-contrib
opentelemetry-bootstrap -a install is unnecessarily slow — recommend piping to pip install in docs
Nobody has claimed this yet.
- 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
-Uflag — 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
- 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 - Consider changing
_run_installto batch all packages into a singlepip installcall instead of looping, which would make--action=installfast 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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