File tree 2 files changed +10
-4
lines changed
instrumentation/opentelemetry-instrumentation-tornado
src/opentelemetry/instrumentation/tornado
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ def _finish_tracing_callback(
113
113
if isinstance (exc , HTTPError ):
114
114
status_code = exc .code
115
115
description = f"{ type (exc ).__name__ } : { exc } "
116
-
116
+
117
117
response = None
118
118
if not exc :
119
119
response = future .result ()
@@ -136,8 +136,12 @@ def _finish_tracing_callback(
136
136
duration_histogram .record (
137
137
response .request_time , attributes = metric_attributes
138
138
)
139
- request_size_histogram .record (request_size , attributes = metric_attributes )
140
- response_size_histogram .record (response_size , attributes = metric_attributes )
139
+ request_size_histogram .record (
140
+ request_size , attributes = metric_attributes
141
+ )
142
+ response_size_histogram .record (
143
+ response_size , attributes = metric_attributes
144
+ )
141
145
142
146
if response_hook :
143
147
response_hook (span , future )
Original file line number Diff line number Diff line change 17
17
from urllib .error import HTTPError
18
18
19
19
from http_server_mock import HttpServerMock
20
- from tornado .testing import AsyncHTTPTestCase
21
20
from tornado .httpclient import HTTPClientError
21
+ from tornado .testing import AsyncHTTPTestCase
22
22
23
23
from opentelemetry import trace
24
24
from opentelemetry .instrumentation .propagators import (
@@ -603,6 +603,7 @@ def client_response_hook(span, response):
603
603
604
604
self .memory_exporter .clear ()
605
605
606
+
606
607
class TestTornadoHTTPClientInstrumentation (TornadoTest , WsgiTestBase ):
607
608
def test_http_client_success_response (self ):
608
609
response = self .fetch ("/" )
@@ -644,6 +645,7 @@ def test_http_client_failed_response(self):
644
645
self .assertEqual (client .name , "GET" )
645
646
self .memory_exporter .clear ()
646
647
648
+
647
649
class TestTornadoUninstrument (TornadoTest ):
648
650
def test_uninstrument (self ):
649
651
response = self .fetch ("/" )
You can’t perform that action at this time.
0 commit comments