open-telemetry / open-telemetry/opentelemetry-python
Parsing console output json objects into ReadableSpan objects
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 19
Description
Is your feature request related to a problem?
I would like to be able to easily parse span objects outputted to stdout via ConsoleSpanExporter into actual span objects with which I can manually export via opentelemetry.
Describe the solution you'd like
Add a ReadableSpan.from_json(XXX) or ReadableSpan.from_dict
Describe alternatives you've considered
No response
Additional Context
I'm writing a script to instrument bash commands during CI. There is currently overhead when exporting to a remote GRPC otel server (while using the python library).
I'm currently writing a python equivalent of otel-cli and I would like to write out console spans to a file/directory and then re-export these spans at the end of a CI pipeline or upload them as an artifact to be parsed by a python library.
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 reviewing ReadableSpan and ConsoleSpanExporter, then inspect the JSON-shaped span output described in the issue and how spans are manually exported through the OpenTelemetry Python library. Done means console output can be parsed into ReadableSpan objects that can be re-exported, with behavior documented and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100