def get_app(self): self.tracer = MockTracer(TornadoScopeManager()) return make_app(self.tracer, trace_client=False, traced_attributes=[ 'version', 'protocol', 'doesnotexist', ])
from tornado.ioloop import IOLoop from tornado.web import Application, RequestHandler from tornado import gen import opentracing import tornado_opentracing from tornado_opentracing.scope_managers import TornadoScopeManager tornado_opentracing.init_tracing() # Your OpenTracing-compatible tracer here. tracer = opentracing.Tracer(scope_manager=TornadoScopeManager()) class MainHandler(RequestHandler): def get(self): self.write({'status': 'ok'}) class StoryHandler(RequestHandler): @gen.coroutine def get(self, story_id): if int(story_id) == 0: raise ValueError('invalid value passed') tracer.active_span.set_tag('processed', True) self.write({'status': 'fetched'})
def get_app(self): self.tracer = MockTracer(TornadoScopeManager()) return make_app(self.tracer, trace_all=False, start_span_cb=self.start_span_cb)
def get_app(self): self.tracer = MockTracer(TornadoScopeManager()) return make_app(self.tracer, trace_all=False)
def get_app(self): self.tracer = MockTracer(TornadoScopeManager()) return make_app(tracer_callable='tests.test_tracing.tracer_callable', tracer_parameters={ 'tracer': self.tracer })
def get_app(self): self.tracer = MockTracer(TornadoScopeManager()) return make_app(tracer_callable=tracer_callable, tracer_parameters={ 'tracer': self.tracer, })
def setUp(self): self.tracer = MockTracer(TornadoScopeManager()) super(TestClient, self).setUp()
import sys import tornado_opentracing from opentracing.mocktracer import MockTracer from tornado_opentracing.scope_managers import TornadoScopeManager if sys.version_info >= (3, 3): from ._test_case_gen import AsyncHTTPTestCase # noqa else: from ._test_case import AsyncHTTPTestCase # noqa tracing = tornado_opentracing.TornadoTracing(MockTracer(TornadoScopeManager()))