예제 #1
0
 def get_app(self):
     self.tracer = MockTracer(TornadoScopeManager())
     return make_app(self.tracer,
                     trace_client=False,
                     traced_attributes=[
                         'version',
                         'protocol',
                         'doesnotexist',
                     ])
예제 #2
0
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'})

예제 #3
0
 def get_app(self):
     self.tracer = MockTracer(TornadoScopeManager())
     return make_app(self.tracer,
                     trace_all=False,
                     start_span_cb=self.start_span_cb)
예제 #4
0
 def get_app(self):
     self.tracer = MockTracer(TornadoScopeManager())
     return make_app(self.tracer,
                     trace_all=False)
예제 #5
0
 def get_app(self):
     self.tracer = MockTracer(TornadoScopeManager())
     return make_app(tracer_callable='tests.test_tracing.tracer_callable',
                     tracer_parameters={
                         'tracer': self.tracer
                     })
예제 #6
0
 def get_app(self):
     self.tracer = MockTracer(TornadoScopeManager())
     return make_app(tracer_callable=tracer_callable, tracer_parameters={
         'tracer': self.tracer,
     })
예제 #7
0
 def setUp(self):
     self.tracer = MockTracer(TornadoScopeManager())
     super(TestClient, self).setUp()
예제 #8
0
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()))