diff --git a/labs/manual-instrumentation-traces/solution/src/app.py b/labs/manual-instrumentation-traces/solution/src/app.py index 6c56e2c..4ad82af 100644 --- a/labs/manual-instrumentation-traces/solution/src/app.py +++ b/labs/manual-instrumentation-traces/solution/src/app.py @@ -26,8 +26,8 @@ def restore_context_on_teardown(err): if previous_ctx_token: context.detach(previous_ctx_token) -@tracer.start_as_current_span("users") @app.route('/users', methods=['GET']) +@tracer.start_as_current_span("users") def get_user(): user, status = db.get_user(123) data = {} @@ -49,8 +49,8 @@ def do_stuff(): url = "http://httpbin:80/anything" _response = requests.get(url, headers=headers) -@tracer.start_as_current_span("index") @app.route('/') +@tracer.start_as_current_span("index") def index(): span = get_current_span() span.set_attributes( @@ -67,4 +67,4 @@ def index(): if __name__ == "__main__": db = ChaosClient(client=FakerClient()) - app.run(host="0.0.0.0", debug = True) \ No newline at end of file + app.run(host="0.0.0.0", debug = True)