Fixed tracing
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-08-04 15:00:41 +02:00
parent 188a31508e
commit 977fc98ed2
3 changed files with 15 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ from magic_doer import MagicDoer
def message_callback(channel, method, properties, body):
with opentracing.tracer.start_span('messageHandling') as span:
with opentracing.tracer.start_active_span('messageHandling', finish_on_close=True) as span:
try:
msg = json.loads(body.decode('utf-8'))
except (UnicodeDecodeError, json.JSONDecodeError) as e:
@@ -28,8 +28,8 @@ def message_callback(channel, method, properties, body):
span.log_kv({'event': 'messageParsed', 'sampleTag': msg['tag']})
with opentracing.tracer.start_span('runAlgorithm', child_of=span) as child_span:
results = MagicDoer.run_everything(msg, child_span) # <- This is where the magic happens
with opentracing.tracer.start_active_span('runAlgorithm', child_of=span) as child_span:
results = MagicDoer.run_everything(msg) # <- This is where the magic happens
if results:
channel.basic_publish(