File: index.md

package info (click to toggle)
aiodogstatsd 0.16.0-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 296 kB
  • sloc: python: 1,080; makefile: 70; sh: 19
file content (40 lines) | stat: -rw-r--r-- 1,266 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# aiodogstatsd

`aiodogstatsd` is an asyncio-based client for sending metrics to StatsD with support of [DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/) extension.

Library fully tested with [statsd_exporter](https://github.com/prometheus/statsd_exporter) and supports `gauge`, `counter`, `histogram`, `distribution` and `timing` types.

!!! info
    `aiodogstatsd` client by default uses _9125_ port. It's a default port for [statsd_exporter](https://github.com/prometheus/statsd_exporter) and it's different from _8125_ which is used by default in StatsD and [DataDog](https://www.datadoghq.com/). Initialize the client with the proper port you need if it's different from _9125_.

## Installation

Just type:

```sh
pip install aiodogstatsd
```

...or if you're interested in integration with [`AIOHTTP`](https://aiohttp.readthedocs.io/) or [`Starlette`](https://www.starlette.io) frameworks specify corresponding extras:

```sh
pip install aiodogstatsd[aiohttp,starlette]
```

## At a glance

Just simply use client as a context manager and send any metric you want:

```python
import asyncio

import aiodogstatsd


async def main():
    async with aiodogstatsd.Client() as client:
        client.increment("users.online")


asyncio.run(main())
```