Skip to content

underyx/aiohttp-datadog

Repository files navigation

aiohttp-datadog

CI Status

An aiohttp middleware for reporting metrics to Datadog. Python 3.5+ is required.

Usage

from aiohttp import web
from aiohttp_datadog import DatadogMiddleware
app = web.Application(
    middlewares=(
        DatadogMiddleware(
            "my_app",
            {"host": "localhost", "port": 8126},
        ),
    ),
)

If you're using a custom DogStatsd class, you can supply it via a keyword argument:

app = web.Application(
    middlewares=(
        DatadogMiddleware(
            "my_app",
            {"host": "localhost", "port": 8126},
            dogstatsd_class=CatStatsd,
        ),
    ),
)

Or if you're even more of a control freak, you can instantiate it yourself:

app = web.Application(
    middlewares=(
        DatadogMiddleware(
            "my_app",
            dogstatsd_instance=CatStatsd(meow=False),
        ),
    ),
)

About

An aiohttp middleware for reporting metrics to Datadog

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages