diff --git a/instana/instrumentation/sanic_inst.py b/instana/instrumentation/sanic_inst.py index a5159058..192f56f8 100644 --- a/instana/instrumentation/sanic_inst.py +++ b/instana/instrumentation/sanic_inst.py @@ -121,7 +121,7 @@ async def handle_request_with_instana(wrapped, instance, args, kwargs): if agent.options.extra_http_headers is not None: extract_custom_headers(scope, headers) await wrapped(*args, **kwargs) - if hasattr(request, "uri_template"): + if hasattr(request, "uri_template") and request.uri_template: scope.span.set_tag("http.path_tpl", request.uri_template) if hasattr(request, "ctx"): # ctx attribute added in the latest v19 versions request.ctx.iscope = scope