Exemplo n.º 1
0
def tracer(transport):
    endpoint = az.create_endpoint("dummy-service")
    sampler = az.Sampler(sample_rate=1.0)
    tracer = az.Tracer(transport, sampler, endpoint)
    tok = _tracer_ctx_var.set(tracer)
    yield tracer
    _tracer_ctx_var.reset(tok)
Exemplo n.º 2
0
    async def start(self, logger: 'ipapp.logger.Logger') -> None:

        endpoint = az.create_endpoint(self.cfg.name)
        sampler = az.Sampler(sample_rate=self.cfg.sample_rate)
        transport = azt.Transport(
            self.cfg.addr,
            send_interval=self.cfg.send_interval,
        )
        self.tracer = az.Tracer(transport, sampler, endpoint)
Exemplo n.º 3
0
    def setup_logging(self,
                      tracer_driver,
                      tracer_svc_name,
                      tracer_url,
                      statsd_addr,
                      statsd_prefix,
                      sample_rate=1.0,
                      send_inteval=3):
        endpoint = az.create_endpoint(tracer_svc_name)
        sampler = az.Sampler(sample_rate=sample_rate)

        transport = TracerTransport(tracer_driver,
                                    tracer_url,
                                    statsd_addr,
                                    statsd_prefix,
                                    send_inteval=send_inteval,
                                    loop=self.loop)

        self._tracer = az.Tracer(transport, sampler, endpoint)
Exemplo n.º 4
0
 def setup_logging(self,
                   tracer_driver=None,
                   tracer_addr=None,
                   tracer_name=None,
                   tracer_sample_rate=1.0,
                   tracer_send_inteval=3,
                   metrics_driver=None,
                   metrics_addr=None,
                   metrics_name=None):
     endpoint = az.create_endpoint(tracer_name)
     sampler = az.Sampler(sample_rate=tracer_sample_rate)
     transport = TracerTransport(self,
                                 tracer_driver,
                                 tracer_addr,
                                 metrics_driver,
                                 metrics_addr,
                                 metrics_name,
                                 send_inteval=tracer_send_inteval,
                                 loop=self.loop)
     self._tracer = Tracer(transport, sampler, endpoint)