Skip to content

Commit

Permalink
move delay to separate span
Browse files Browse the repository at this point in the history
  • Loading branch information
steveww committed Jul 18, 2018
1 parent fe2e165 commit ac05aa6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions payment/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ def pay(id):

def queueOrder(order):
app.logger.info('queue order')
# For screenshot demo requirements optionally add in a bit of delay
delay = int(os.getenv('PAYMENT_DELAY_MS', 0))
time.sleep(delay / 1000)

# RabbitMQ is not currently traced automatically
# opentracing tracer is automatically set to Instana tracer
# start a span
Expand All @@ -67,6 +63,10 @@ def queueOrder(order):
}
)

# For screenshot demo requirements optionally add in a bit of delay
delay = int(os.getenv('PAYMENT_DELAY_MS', 0))
time.sleep(delay / 1000)

headers = {}
ot.tracer.inject(span.context, ot.Format.HTTP_HEADERS, headers)
app.logger.info('msg headers {}'.format(headers))
Expand Down

0 comments on commit ac05aa6

Please sign in to comment.