Skip to main content

No project description provided

Project description

Business Monitor

Installation

pip install biz-monitor

Usage

Flask

Insert following code after you initialized Flask app instance:

from biz_monitor.biz_tracing.flask_opentracing import init_tracing
from biz_monitor.biz_logging.log import init_logging
init_tracing("service name", "jaeger_agent uri, e.g. localhost:6831", "kafka uri, e.g. localhost:9092", 'IDC', 'set0', 'instance-0', app)
log = init_logging("service name", 'IDC', 'set0', 'instance-0')
Tornado

Insert following code before you initialize tornado.web.Application instance:

from biz_monitor.biz_logging import init_async_logging
from biz_monitor.biz_tracing.tornado_opentracing import init_tracing
init_tracing("service name", "jaeger_agent uri, e.g. localhost:6831", "kafka uri, e.g. localhost:9092", "IDC", "set0", 'instance-0')
log = init_async_logging("service_name", "IDC", "set0", "instance-0")
aiohttp
import aiohttp
import aiohttp.web
from biz_monitor.biz_logging import init_async_logging
from biz_monitor.biz_tracing.aiohttp_opentracing import init_tracing, trace_config
log = init_async_logging("service_name", "IDC", "set0", "instance-0")
metrics_middleware = init_tracing("service_name", "jaeger_agent uri, e.g. localhost:6831", "kafka uri, e.g. localhost:9092", "IDC", "set0", 'instance-0')
# Insert metrics_middleware into application's middlewares
app = aiohttp.web.Application(middlewares=[metrics_middleware, ...])
# Add trace_config to aiohttp.ClientSession
async def fetch():
    async with aiohttp.ClientSession(trace_configs=[trace_config]) as session:
        async with session.get("http://localhost:5000/demo") as resp:
            pass

Description

This project is used for "Metrics, tracing, and logging". It's an integration of python libraries for opentracing, including:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for biz-monitor, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size biz_monitor-0.5.0-py3-none-any.whl (22.2 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page