Manage http requests metrics via StatsD.
Project description
=====
Django request monitoring
=====
Manage http requests metrics via StatsD.
Middlewares:
-----------
- RequestLatencyMiddleware: Used to track the statistical distribution of request time duration.
Use:
----
.. code-block:: python
# settings.py
INSTALLED_APPS = [
# .
# .
# .
"monitoring.apps.MonitoringConfig"
]
MIDDLEWARE = [
'monitoring.middleware.RequestLatencyMiddleware',
# .
# .
# .
]
STATSD_HOST = '0.0.0.0'
STATSD_PORT = 9125
STATSD_PREFIX = None
STATSD_MAXUDPSIZE = 512
REQUEST_LATENCY_MIDDLEWARE_HIST = "request.duration.seconds"
REQUEST_LATENCY_MIDDLEWARE_TAGS = []
Examples:
---------
.. code-block:: bash
$ git pull https://github.com/emilioag/django-requests-monitoring.git
$ cd django-requests-monitoring
$ docker-compose -f docker-compose-example-simple-project.yaml up
$ curl -s 127.0.0.1:9102/metrics | grep myrequest
$ curl -s 127.0.0.1:8000 > /dev/null
$ curl -s 127.0.0.1:9102/metrics | grep myrequest
# HELP myrequest_duration_in_seconds Metric autogenerated by statsd_exporter.
# TYPE myrequest_duration_in_seconds summary
myrequest_duration_in_seconds{endpoint="/",quantile="0.5"} 0.00593113899230957
myrequest_duration_in_seconds{endpoint="/",quantile="0.9"} 0.00593113899230957
myrequest_duration_in_seconds{endpoint="/",quantile="0.99"} 0.00593113899230957
myrequest_duration_in_seconds_sum{endpoint="/"} 0.00593113899230957
myrequest_duration_in_seconds_count{endpoint="/"} 1
Django request monitoring
=====
Manage http requests metrics via StatsD.
Middlewares:
-----------
- RequestLatencyMiddleware: Used to track the statistical distribution of request time duration.
Use:
----
.. code-block:: python
# settings.py
INSTALLED_APPS = [
# .
# .
# .
"monitoring.apps.MonitoringConfig"
]
MIDDLEWARE = [
'monitoring.middleware.RequestLatencyMiddleware',
# .
# .
# .
]
STATSD_HOST = '0.0.0.0'
STATSD_PORT = 9125
STATSD_PREFIX = None
STATSD_MAXUDPSIZE = 512
REQUEST_LATENCY_MIDDLEWARE_HIST = "request.duration.seconds"
REQUEST_LATENCY_MIDDLEWARE_TAGS = []
Examples:
---------
.. code-block:: bash
$ git pull https://github.com/emilioag/django-requests-monitoring.git
$ cd django-requests-monitoring
$ docker-compose -f docker-compose-example-simple-project.yaml up
$ curl -s 127.0.0.1:9102/metrics | grep myrequest
$ curl -s 127.0.0.1:8000 > /dev/null
$ curl -s 127.0.0.1:9102/metrics | grep myrequest
# HELP myrequest_duration_in_seconds Metric autogenerated by statsd_exporter.
# TYPE myrequest_duration_in_seconds summary
myrequest_duration_in_seconds{endpoint="/",quantile="0.5"} 0.00593113899230957
myrequest_duration_in_seconds{endpoint="/",quantile="0.9"} 0.00593113899230957
myrequest_duration_in_seconds{endpoint="/",quantile="0.99"} 0.00593113899230957
myrequest_duration_in_seconds_sum{endpoint="/"} 0.00593113899230957
myrequest_duration_in_seconds_count{endpoint="/"} 1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-requests-monitoring-0.1.0.tar.gz
.
File metadata
- Download URL: django-requests-monitoring-0.1.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d96a4f8dca0499654c6ce5bc9c4ee56a524ceb6e62f692d99255db46e441118 |
|
MD5 | d4edabbffd9ac1136bc07538580732f0 |
|
BLAKE2b-256 | 7d8b0386d44c8f335177442399d0dfc09e520ac44018fd1215c0b311ecc4b3b0 |