open-telemetry / open-telemetry/opentelemetry-python-contrib

RichConsoleSpanExporter infinite loop

Open
#1,897 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

Test script:

from time import sleep
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider, Resource
from opentelemetry.sdk.trace.export import (
   SimpleSpanProcessor,
)
from opentelemetry.exporter.richconsole import RichConsoleSpanExporter

provider = TracerProvider(resource=Resource(attributes={"service.name": "test"}))
processor = SimpleSpanProcessor(RichConsoleSpanExporter(service_name='test'))
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("rootSpan"):
    with tracer.start_as_current_span("childSpan"):
        sleep(0.1)

For me it never finishes, it seems to be stuck in a loop in RichConsoleSpanExporter.spans_to_tree. Works fine with ConsoleSpanExporter.

Env:

opentelemetry-api==1.19.0
opentelemetry-exporter-otlp==1.19.0
opentelemetry-exporter-otlp-proto-common==1.19.0
opentelemetry-exporter-otlp-proto-grpc==1.19.0
opentelemetry-exporter-otlp-proto-http==1.19.0
opentelemetry-exporter-richconsole==0.40b0
opentelemetry-proto==1.19.0
opentelemetry-sdk==1.19.0
opentelemetry-semantic-conventions==0.40b0

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

Run the provided Python reproduction with RichConsoleSpanExporter and inspect RichConsoleSpanExporter.spans_to_tree, where the report identifies the infinite loop. Compare the behavior with ConsoleSpanExporter. Done means the reproduction finishes normally and the exporter still produces its expected output for the nested rootSpan and childSpan.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.