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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

biz_monitor-0.5.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file biz_monitor-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: biz_monitor-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for biz_monitor-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34c262b29860fc468379063ce36a227f739ec0d374844fbbf0a8b970653b5d5e
MD5 153a07e861c5d41a10154cf00338f8aa
BLAKE2b-256 b1b9dd53ba203ad6e769d07ee5e39962904b9ed0448f70f02d16afb10f8b085a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page