INNER CODE UNIT · Python
return_hostname
aws-samples/aws-workshop-for-kubernetes · 03-path-application-development/306-app-tracing-with-jaeger-and-x-ray/x-ray/python-flask-app/app.py:35
def return_hostname():
return "This is an example wsgi app served from {} to {}".format(socket.gethostname(), request.remote_addr)
@app.route("/env")
def env():
return os.environ['AWS_XRAY_DAEMON_ADDRESS']
@app.route('/fib/<int:number>')
def index(number=1):
result = fib(number)
return "Python Fib("+ str(number) + "): " + str(result)
@xray_recorder.capture('Fibonnaci')
def fib(n):
if n == 0:
return 0
elif n == 1: