Skip to content

Jeager exporter fails on events with empty attributes #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GoPavel opened this issue Jan 28, 2020 · 2 comments
Closed

Jeager exporter fails on events with empty attributes #383

GoPavel opened this issue Jan 28, 2020 · 2 comments
Labels
bug Something isn't working exporters

Comments

@GoPavel
Copy link
Contributor

GoPavel commented Jan 28, 2020

Jaeger exporter not properly handles export events. The specification states that the attributes of an event are optional. So I expect that the following code is correct.

with tracer.start_as_current_span('span') as span:
  span.add_event('Hello')

But it fails with the message:

Exception while exporting Span batch.
Traceback (most recent call last):
  File "PKG-PATH/opentelemetry/sdk/trace/export/__init__.py", line 190, in export
    self.spans_list[:idx]
  File "PKG-PATH/opentelemetry/ext/jaeger/__init__.py", line 109, in export
    jaeger_spans = _translate_to_jaeger(spans)
  File "PKG-PATH/opentelemetry/ext/jaeger/__init__.py", line 160, in _translate_to_jaeger
    logs = _extract_logs_from_span(span)
  File "PKG-PATH/site-packages/opentelemetry/ext/jaeger/__init__.py", line 229, in _extract_logs_from_span
    fields.append(
AttributeError: 'NoneType' object has no attribute 'append'

After reading source code I find that Span.add_event has right signature, and use Span.emprty_attributes as default, but exporter is wrong. _extract_tags(attr) returns None if attr is Span.empty_attributes (aka empty dict).

@GoPavel GoPavel added the bug Something isn't working label Jan 28, 2020
@mauriciovasquezbernal
Copy link
Member

This will be solved by #367.

@mauriciovasquezbernal
Copy link
Member

mauriciovasquezbernal commented Jan 29, 2020

I performed a test with the example provided in this issue:

with tracer.start_as_current_span('span') as span:
  span.add_event('Hello')

and it works fine. I'll close it. @GoPavel thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporters
Projects
None yet
Development

No branches or pull requests

2 participants