Skip to content

Commit

Permalink
fix(confluent-kafka): changed function order
Browse files Browse the repository at this point in the history
  • Loading branch information
javferrod committed Aug 19, 2023
1 parent 1815057 commit 51167dd
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ def _create_new_consume_span(instance, tracer, records):
)


def _get_links_from_records(records):
links = []
for record in records:
ctx = propagate.extract(record.headers(), getter=_kafka_getter)
if ctx:
for item in ctx.values():
if hasattr(item, "get_span_context"):
links.append(Link(context=item.get_span_context()))

return links


def _enrich_span(
span,
topic,
Expand Down Expand Up @@ -134,18 +146,6 @@ def _enrich_span(
)


def _get_links_from_records(records):
links = []
for record in records:
ctx = propagate.extract(record.headers(), getter=_kafka_getter)
if ctx:
for item in ctx.values():
if hasattr(item, "get_span_context"):
links.append(Link(context=item.get_span_context()))

return links


_kafka_setter = KafkaContextSetter()


Expand Down

0 comments on commit 51167dd

Please sign in to comment.