Skip to content

Commit c3f7fd7

Browse files
authored
fixing bug for sanic app deployed using sanic server 19.3.1 (#332)
* fixing bug for sanic app deployed using sanic server 19.3.1
1 parent 1182783 commit c3f7fd7

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

instana/instrumentation/sanic_inst.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ async def handle_request_with_instana(wrapped, instance, args, kwargs):
107107
scope.span.set_tag('http.path', request.path)
108108
scope.span.set_tag('http.method', request.method)
109109
scope.span.set_tag('http.host', request.host)
110-
scope.span.set_tag("http.url", request.url)
110+
if hasattr(request, "url"):
111+
scope.span.set_tag("http.url", request.url)
111112

112113
query = request.query_string
113114

instana/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
# Module version file. Used by setup.py and snapshot reporting.
55

6-
VERSION = '1.34.0'
6+
VERSION = '1.34.1'

tests/frameworks/test_sanic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_404(self):
9292
self.assertEqual(result.status_code, 404)
9393

9494
spans = tracer.recorder.queued_spans()
95-
self.assertEqual(len(spans), 4)
95+
self.assertEqual(len(spans), 3)
9696

9797
span_filter = lambda span: span.n == "sdk" and span.data['sdk']['name'] == 'test'
9898
test_span = get_first_span_by_filter(spans, span_filter)

0 commit comments

Comments
 (0)