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


Download files

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

Source Distribution

django-requests-monitoring-0.1.0.tar.gz (9.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page