open-telemetry / open-telemetry/opentelemetry-python-contrib
Executing opentelemetry-instrument.exe on an app with a path with space doesn't work
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
Describe your environment
OS: Windows
Python version: 3.13.1
Package version: opentelemetry-instrument 0.50b0
What happened?
Trying to instrument an app with a space in the path doesn't appear to work.
Steps to Reproduce
D:\My Temp\AspireWithPython\InstrumentedPythonProject>.venv\Scripts\opentelemetry-instrument.exe --traces_exporter otlp --logs_exporter console,otlp --metrics_exporter otlp "D:\My Temp\AspireWithPython\InstrumentedPythonProject\.venv\Scripts\python.exe" app.py
D:\My: can't open file 'D:\\My Temp\\AspireWithPython\\InstrumentedPythonProject\\Temp\\AspireWithPython\\InstrumentedPythonProject\\.venv\\Scripts\\python.exe': [Errno 2] No such file or directory
Expected Result
I expect the app to run successfully.
Actual Result
The above error occurs:
D:\My: can't open file 'D:\\My Temp\\AspireWithPython\\InstrumentedPythonProject\\Temp\\AspireWithPython\\InstrumentedPythonProject\\.venv\\Scripts\\python.exe': [Errno 2] No such file or directory
Additional context
Initially reported through AddPythonApp crashes because it does not double quote paths with spaces in arguments list (dotnet/aspire#6841).
Would you like to implement a fix?
None
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 by reproducing the documented Windows command with the opentelemetry-instrument.exe entry point and a project path containing spaces. Trace how that entry point handles the application path and arguments, then add coverage for this invocation if the surrounding test structure supports it. Done means the instrumented app launches successfully from a path with spaces without duplicating or truncating the path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100