This commit is contained in:
@@ -19,16 +19,16 @@ from magic_doer import MagicDoer
|
||||
|
||||
|
||||
def message_callback(channel, method, properties, body):
|
||||
with opentracing.tracer.start_active_span('messageHandling', finish_on_close=True) as span:
|
||||
with opentracing.tracer.start_active_span('main.handleMessage', finish_on_close=True) as scope:
|
||||
try:
|
||||
msg = json.loads(body.decode('utf-8'))
|
||||
except (UnicodeDecodeError, json.JSONDecodeError) as e:
|
||||
logging.warning(f"Invalid message recieved: {e}")
|
||||
return
|
||||
|
||||
span.log_kv({'event': 'messageParsed', 'sampleTag': msg['tag']})
|
||||
scope.span.log_kv({'event': 'messageParsed', 'sampleTag': msg['tag']})
|
||||
|
||||
with opentracing.tracer.start_active_span('runAlgorithm', child_of=span) as child_span:
|
||||
with opentracing.tracer.start_active_span('magicDoer.run_everything'):
|
||||
results = MagicDoer.run_everything(msg) # <- This is where the magic happens
|
||||
|
||||
if results:
|
||||
|
||||
Reference in New Issue
Block a user