Skip to main content

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

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-requests-monitoring-0.1.0.tar.gz (9.2 kB) Copy SHA256 hash SHA256 Source None Jun 14, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page