
Zipkin is a trend distributed tracing framewrok developed at Twitter. Such tracing is useful for both developers and operatos to understand the behavior of complex distributed systems and find performance bottlenecks. This patch provides a WSGI application using eventlet with tracing facility that complies with Zipkin. Signed-off-by: Yuichi Bando <bando.yuichi@lab.ntt.co.jp> Original commit modified for PEP-8 fixes. https://github.com/eventlet/eventlet/pull/218
20 lines
337 B
Python
20 lines
337 B
Python
import logging
|
|
|
|
from eventlet.zipkin import api
|
|
|
|
|
|
__original_handle__ = logging.Logger.handle
|
|
|
|
|
|
def _patched_handle(self, record):
|
|
__original_handle__(self, record)
|
|
api.put_annotation(record.getMessage())
|
|
|
|
|
|
def patch():
|
|
logging.Logger.handle = _patched_handle
|
|
|
|
|
|
def unpatch():
|
|
logging.Logger.handle = __original_handle__
|