All Projects → koslib → django-traffic

koslib / django-traffic

Licence: MIT license
Django middleware that helps visualize your app's traffic in Kibana

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to django-traffic

twitter-sentiment-analysis
Streaming tweets with spark, language detection & sentiment analysis, dashboard with Kibana
Stars: ✭ 100 (+75.44%)
Mutual labels:  kibana
spring-boot-microservice-eureka-zuul-docker-gateway-kubernetes
Spring Boot rest microservices using Kubernetes, ConfigMap, Eureka, Zuul / Spring Boot Gateway, Docker. Monitoring with logstash, logback, elasticsearch, kibana.
Stars: ✭ 86 (+50.88%)
Mutual labels:  kibana
stagemonitor-kibana
Kibana-Plugin for stagemonitor trace visualization
Stars: ✭ 13 (-77.19%)
Mutual labels:  kibana
TelephoneDirectory
microservices-> .net 6, golang - Docker, Ocelot, RabbitMq, MassTransit, mssql, postgresql, elasticsearch, kibana, jwt
Stars: ✭ 40 (-29.82%)
Mutual labels:  kibana
frontreport
Simple frontend logging collector written in Go
Stars: ✭ 23 (-59.65%)
Mutual labels:  kibana
k8s-elk
Kubernetes ELK - ElasticSearch, Kibana, Logstash, and all the trimmings
Stars: ✭ 37 (-35.09%)
Mutual labels:  kibana
docker-elk-stack
The ELK stack Docker containerization (Elasticsearch, Logstash and Kibana)
Stars: ✭ 20 (-64.91%)
Mutual labels:  kibana
kibana-keycloak
Secure kibana dashboards using keycloak
Stars: ✭ 40 (-29.82%)
Mutual labels:  kibana
docker-metricbeat-example
Elasticsearch Metricbeat example configuration to monitor Host and Services with docker
Stars: ✭ 80 (+40.35%)
Mutual labels:  kibana
skalogs-bundle
Open Source data and event driven real time Monitoring and Analytics Platform
Stars: ✭ 16 (-71.93%)
Mutual labels:  kibana
kibana-xlsx-import
Kibana plugin for import XLSX/CSV file to ElasticSearch
Stars: ✭ 58 (+1.75%)
Mutual labels:  kibana
ansible-role-kibana
Ansible Role - Kibana
Stars: ✭ 104 (+82.46%)
Mutual labels:  kibana
next-eui-starter
Start building Kibana protoypes quickly with the Next.js EUI Starter
Stars: ✭ 74 (+29.82%)
Mutual labels:  kibana
logrus-redis-hook
Hook for Logrus which enables logging to RELK stack (Redis, Elasticsearch, Logstash and Kibana)
Stars: ✭ 33 (-42.11%)
Mutual labels:  kibana
PALallax
PALallax is a Paloalto Next Generation Firewall Log Collector
Stars: ✭ 13 (-77.19%)
Mutual labels:  kibana
docker-case
这个项目主要是为了快速拉起docker服务
Stars: ✭ 31 (-45.61%)
Mutual labels:  kibana
spring-boot-elk
An sample todo app demonstrating centralised logging using ELK stack
Stars: ✭ 20 (-64.91%)
Mutual labels:  kibana
seahorse
ELKFH - Elastic, Logstash, Kibana, Filebeat and Honeypot (HTTP, HTTPS, SSH, RDP, VNC, Redis, MySQL, MONGO, SMB, LDAP)
Stars: ✭ 31 (-45.61%)
Mutual labels:  kibana
ether-to-elasticsearch
Dump etherum stats into elastic search
Stars: ✭ 31 (-45.61%)
Mutual labels:  kibana
eslog tutorial
From Raw Logs to Real Insights - A tutorial for getting started with log analytics using Elastic Stack.
Stars: ✭ 28 (-50.88%)
Mutual labels:  kibana

django-traffic

A Django middleware that helps visualize your app's traffic in Kibana

In a nutshell, by using this middleware you need no more effort to stream your app's traffic in your ElasticSearch host(s) and use Kibana for visualizations around it.

Request information transmitted to ElasticSearch:

  • timestamp | type: date
  • location | type: geo_point
  • method | type: string
  • body | type: string
  • path | type: string
  • path_info | type: string
  • scheme | type: string
  • encoding | type: string
  • encoding_type | type: string, supported only in Django 1.10 and later
  • ip | type: ip

Geolocation is achieved by using django.contrib.gis.geoip2.GeoIP2 wrapper, included in Django 1.9 and latter.

Quick Start

1. Install using pip:

pip install django-traffic

To install the latest version directly from GitHub:

pip install git+https://github.com/koslibpro/django-traffic

2. Include "django-traffic" in your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'django_traffic',
]

3. Include "ESTrafficInfoMiddleware" to your MIDDLEWARE_CLASSES:

MIDDLEWARE_CLASSES = (
    ...
    'django_traffic.middleware.ESTrafficInfoMiddleware',
)

The middleware is created in a way that supports both MIDDLEWARE_CLASSES on Django older versions and MIDDLEWARE in latest Django versions.

Configuration

There are some variables required in your settings.py file to function normally.

  • TRAFFIC_INDEX_NAME: this is the name of the index that will be used in ElasticSearch. If you leave this empty or do not define it, the default index name will be applied: django-traffic.

  • ES_CLIENT: if you already have an ElasticSearch() client instance ready in your app, we'll use this one be default.

  • ES_HOST: this is required only if you don't have an ES_CLIENT defined. Here the lib expects to find a hostname (including the port) of your ElasticSearch instance.

  • GEO_DB_PATH: if you don't have GEOIP_PATH already defined, you need to define the path where django can find your geolocation database.

  • LOG_WITHOUT_LOCATION: (default False) log data even when ip cannot be translated to location

After you deploy your project or locally run your django server, requests and traffic to your web app will be sent to the ElasticSearch hosts defined. Practically you are ready to create a Kibana map-tile visualization and start watching where traffic is flooding you in.

Contributing - Error Reporting

This lib was made with my own needs in mind, so it's uncommon to fit everyone's project out there. For Error Reporting, open an issue in Github and I will try to take care of it as soon as possible. If you are able to contribute to this lib and make it better, feel free to fork it and adjust it to your use-case.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].