open-telemetry / open-telemetry/opentelemetry-python

Parsing console output json objects into ReadableSpan objects

Open
#4,357 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.