Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 1262e7f

Browse files
meridionalsongy23
authored andcommitted
jaeger exporter: check whether time_event.annotation is None (#303)
1 parent d9f3234 commit 1262e7f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

opencensus/trace/exporters/jaeger_exporter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ def _extract_logs_from_span(span):
278278
logs = []
279279
for time_event in span.time_events:
280280
annotation = time_event.annotation
281+
if not annotation:
282+
continue
281283
fields = _extract_tags(annotation.attributes)
282284

283285
fields.append(jaeger.Tag(

tests/unit/trace/exporters/test_jaeger_exporter.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,13 @@ def test_translate_to_jaeger(self):
200200
timestamp=time,
201201
annotation=time_event.Annotation(
202202
description='First Annotation',
203-
attributes=annotation_attributes))
203+
attributes=annotation_attributes)),
204+
time_event.TimeEvent(
205+
timestamp=time,
206+
message_event=time_event.MessageEvent(
207+
id='message-event-id',
208+
uncompressed_size_bytes=0,
209+
)),
204210
]
205211

206212
links = [

0 commit comments

Comments
 (0)