Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Jaeger Propagator not handling missing carrier #1542

Closed
@ehiggs

Description

@ehiggs

Python 3.8 / Flask injector 0.17b0

Steps to reproduce
If jaeger is the text map and you do not send a carrier header then the parser fails when it tries to parse the carrier header.

        if context is None:
            context = get_current()
        fields = _extract_first_element(
            getter.get(carrier, self.TRACE_ID_KEY)
        ).split(":")

**What is the expected **
Parse as invalid span. Code continues.

What is the actual behavior?

File "/usr/local/lib/python3.8/site-packages/opentelemetry/propagators/jaeger/__init__.py", line 48, in extract
 fields = _extract_first_element(
AttributeError: 'NoneType' object has no attribute ‘split’

Additional context
TraceContextTextMapPropagator does this:

        header = getter.get(carrier, self._TRACEPARENT_HEADER_NAME)

        if not header:
            return trace.set_span_in_context(trace.INVALID_SPAN, context)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions