Skip to main content

Django middlewares to monitor your application with Prometheus.io.

Project description

# django-prometheus
Export Django monitoring metrics for Prometheus.io

## Usage

This is still very experimental, so no Pypi package for you yet.

### Installation

Install with:
```shell
python path-to-where-you-cloned-django-prometheus/setup.py install
```

This will install [prometheus_client](https://github.com/prometheus/client_python) as a dependency.

### Configuration

In your settings.py:

```python
INSTALLED_APPS = (
...
'django_prometheus',
...
)

MIDDLEWARE_CLASSES = (
'django_prometheus.middleware.PrometheusBeforeMiddleware',
# All your other middlewares go here, including the default
# middlewares like SessionMiddleware, CommonMiddleware,
# CsrfViewmiddleware, SecurityMiddleware, etc.
'django_prometheus.middleware.PrometheusAfterMiddleware',
)
```

### Exported metrics

Currently, the PrometheusBeforemiddleware will start an HTTP server in
a thread on port 8001 to export the metrics. This will become
configurable in the future.

Project details


Release history Release notifications | RSS feed

This version

0.0.1

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