open-telemetry / open-telemetry/opentelemetry-python-contrib
Create a python autoinstrumentor
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
Hello all,
It would be convenient to have a python autoinstrumentor, which would create a new span for each function, add inputs and outputs of functions as attributes etc...
I would just call PythonInstrumentor.instrument() and I would receive the traces for all function calls and returns in my collector.
There might be different ways to do that, the first easy way I see is to use the sys.monitoring to start a span on function calls and terminate them on function returns
Questions:
- Does a python autoinstrumentor like this already exist ?
- If it does not exist, why is it a bad idea ?
Also do you see reasons why it would be a bad idea to implement this python instrumentor using sys.monitoring ?
Thank you for your responses
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 reviewing the proposed PythonInstrumentor.instrument() API and Python's sys.monitoring function-call and return events. Check whether an equivalent autoinstrumentor already exists, then assess the scope and trade-offs of creating spans with function inputs and outputs. Done requires a decided implementation direction and defined behavior, which this issue does not currently specify.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100