itrsstatsd
Python module for publishing custom metrics to an ITRS StatsD server.
The module is part of the Orchestrated Netprobe solution for collecting metrics in orchestrated environments. See the docs for complete details.
Requirements
- Python 3.7
Installation
The module is available via PyPI:
pip3 install itrsstatsd
Module Documentation
How to get and use a statsd API handle:
pydoc3 itrsstatsd
API documentation:
pydoc3 itrsstatsd.api
Units of measure documentation:
pydoc3 itrsstatsd.units
Getting Started
from itrsstatsd import build_statsd
from itrsstatsd.units import Unit
from itrsstatsd.severity import Severity
# Create an instance of the client that sends to localhost:8125
statsd = build_statsd()
# Optionally add dimension(s) to all metrics
statsd.default_dimensions(app_name="pyapp")
# Record some metrics
statsd.increment("failed_logins")
statsd.gauge("cache_size", 52.5, Unit.Megabytes)
statsd.timer("query_time", 56)
statsd.event("event_name_1", "event_message", Severity.INFO)
statsd.attribute("attr_name_1", "A1")
Refer to the pydoc for complete usage details.
Change Log
v2.0.0 (2020-04-01)
New Features:
- C2-76: Added event and attribute support
- C2-124: Added new units of measure
v1.4.0 (2019-12-20)
New Features:
-
C2-92: StatsD configuration via environment variables
This introduces the following changes:
- Breaking:
STATSD_SERVERandSTATSD_PORTenvironment variables now have precedence over the hostname and port configured in code. - New
STATSD_PROTOCOLenvironment variable which can be set totcporudpand overrides the protocol configured in code. - New
STATSD_DISABLE_PLATFORM_DIMENSIONSenvironment variable which, iftrue, will prevent the platform-specific dimensions from being added to each metric. This overrides the value configured in code. - Custom dimensions can be configured via
STATSD_DIMENSION_*environment variable(s).
- Breaking:
Resolved:
- C2-98: StatsD client blocks when connecting to server via TCP
v1.3.0 (2019-09-11)
New Features:
- License changed to BSD 3-Clause
- C2-77: Nano and micro resolution in timer metrics
Resolved:
- C2-78: Statsd client sends malformed message with sample rate
v1.2.0 (2019-08-23)
New Features:
- C2-72: Discard oldest metrics when sending queue full
v1.1.0 (2019-08-23)
New Features:
- C2-69: Statsd over TCP
v1.0.0 (2019-08-15)
First version.
Metadata
Release files for itrsstatsd 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| itrsstatsd-2.0.0.tar.gz | 10.0 kB | Without provenance | Details for itrsstatsd-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| itrsstatsd-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for itrsstatsd-2.0.0-py3-none-any.whl |
Total release size: 22.8 kB
Release files / itrsstatsd-2.0.0.tar.gz
| Download URL | itrsstatsd-2.0.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ec70a78c92c31ee9c401ecf9f68e57845e266c898b092365522dca32fc50c3d
|
|
BLAKE2b-256 checksum How to use checksums |
d5f9004ea2c68ed27966e23fb1275daf57a094383e8bd8a26de574606a338d28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.6
|
Release files / itrsstatsd-2.0.0-py3-none-any.whl
| Download URL | itrsstatsd-2.0.0-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ded0e12cf2fb69a5b973fa8e972e28777b8e3a2da8cbd9ae9d9859e403b6084
|
|
BLAKE2b-256 checksum How to use checksums |
f4ec4fcfce0b7fa33080f34d6ac27cac887219dc7e217d65ddace9d4fab909a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.6
|
Security for itrsstatsd 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.