setu-trafficmonitor 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- setu_trafficmonitor-2.0.0.dist-info/LICENSE +21 -0
- setu_trafficmonitor-2.0.0.dist-info/METADATA +401 -0
- setu_trafficmonitor-2.0.0.dist-info/RECORD +42 -0
- setu_trafficmonitor-2.0.0.dist-info/WHEEL +5 -0
- setu_trafficmonitor-2.0.0.dist-info/top_level.txt +1 -0
- trafficmonitor/__init__.py +11 -0
- trafficmonitor/admin.py +217 -0
- trafficmonitor/analytics/__init__.py +0 -0
- trafficmonitor/analytics/enhanced_queries.py +286 -0
- trafficmonitor/analytics/serializers.py +238 -0
- trafficmonitor/analytics/tests.py +757 -0
- trafficmonitor/analytics/urls.py +18 -0
- trafficmonitor/analytics/views.py +694 -0
- trafficmonitor/apps.py +7 -0
- trafficmonitor/circuit_breaker.py +63 -0
- trafficmonitor/conf.py +154 -0
- trafficmonitor/dashboard_security.py +111 -0
- trafficmonitor/db_utils.py +37 -0
- trafficmonitor/exceptions.py +93 -0
- trafficmonitor/health.py +66 -0
- trafficmonitor/load_test.py +423 -0
- trafficmonitor/load_test_api.py +307 -0
- trafficmonitor/management/__init__.py +1 -0
- trafficmonitor/management/commands/__init__.py +1 -0
- trafficmonitor/management/commands/cleanup_request_logs.py +77 -0
- trafficmonitor/middleware.py +383 -0
- trafficmonitor/migrations/0001_initial.py +93 -0
- trafficmonitor/migrations/__init__.py +0 -0
- trafficmonitor/models.py +206 -0
- trafficmonitor/monitoring.py +104 -0
- trafficmonitor/permissions.py +64 -0
- trafficmonitor/security.py +180 -0
- trafficmonitor/settings_production.py +105 -0
- trafficmonitor/static/analytics/css/dashboard.css +99 -0
- trafficmonitor/static/analytics/js/dashboard-production.js +339 -0
- trafficmonitor/static/analytics/js/dashboard-v2.js +697 -0
- trafficmonitor/static/analytics/js/dashboard.js +693 -0
- trafficmonitor/tasks.py +137 -0
- trafficmonitor/templates/analytics/dashboard.html +500 -0
- trafficmonitor/tests.py +246 -0
- trafficmonitor/views.py +3 -0
- trafficmonitor/websocket_consumers.py +128 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 FarmSetu Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: setu-trafficmonitor
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: A comprehensive Django app for logging HTTP requests with analytics dashboard
|
|
5
|
+
Home-page: https://github.com/farmsetu/django-trafficmonitor
|
|
6
|
+
Author: FarmSetu Team
|
|
7
|
+
Author-email: FarmSetu Team <tech@farmsetu.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/farmsetu/django-trafficmonitor
|
|
10
|
+
Project-URL: Documentation, https://github.com/farmsetu/django-trafficmonitor/blob/master/README.md
|
|
11
|
+
Project-URL: Repository, https://github.com/farmsetu/django-trafficmonitor
|
|
12
|
+
Project-URL: Bug Tracker, https://github.com/farmsetu/django-trafficmonitor/issues
|
|
13
|
+
Project-URL: Changelog, https://github.com/farmsetu/django-trafficmonitor/blob/master/CHANGELOG.md
|
|
14
|
+
Keywords: django,request,logging,analytics,monitoring,middleware,dashboard,traffic,http
|
|
15
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
+
Classifier: Environment :: Web Environment
|
|
17
|
+
Classifier: Framework :: Django
|
|
18
|
+
Classifier: Framework :: Django :: 3.2
|
|
19
|
+
Classifier: Framework :: Django :: 4.0
|
|
20
|
+
Classifier: Framework :: Django :: 4.1
|
|
21
|
+
Classifier: Framework :: Django :: 4.2
|
|
22
|
+
Classifier: Framework :: Django :: 5.0
|
|
23
|
+
Classifier: Intended Audience :: Developers
|
|
24
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
25
|
+
Classifier: Operating System :: OS Independent
|
|
26
|
+
Classifier: Programming Language :: Python
|
|
27
|
+
Classifier: Programming Language :: Python :: 3
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
29
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
30
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
33
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
34
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
35
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
|
|
36
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
37
|
+
Classifier: Topic :: System :: Monitoring
|
|
38
|
+
Classifier: Topic :: System :: Logging
|
|
39
|
+
Requires-Python: >=3.8
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Dist: Django <6.0,>=3.2
|
|
43
|
+
Requires-Dist: celery >=5.0.0
|
|
44
|
+
Requires-Dist: djangorestframework >=3.12.0
|
|
45
|
+
Requires-Dist: redis >=4.0.0
|
|
46
|
+
Provides-Extra: dev
|
|
47
|
+
Requires-Dist: black >=23.0 ; extra == 'dev'
|
|
48
|
+
Requires-Dist: flake8 >=6.0 ; extra == 'dev'
|
|
49
|
+
Requires-Dist: isort >=5.12 ; extra == 'dev'
|
|
50
|
+
Requires-Dist: mypy >=1.0 ; extra == 'dev'
|
|
51
|
+
Requires-Dist: pytest-cov >=4.0 ; extra == 'dev'
|
|
52
|
+
Requires-Dist: pytest-django >=4.5 ; extra == 'dev'
|
|
53
|
+
Requires-Dist: pytest >=7.0 ; extra == 'dev'
|
|
54
|
+
Provides-Extra: production
|
|
55
|
+
Requires-Dist: django-redis >=5.0.0 ; extra == 'production'
|
|
56
|
+
Requires-Dist: gunicorn >=20.0.0 ; extra == 'production'
|
|
57
|
+
Requires-Dist: psycopg2-binary >=2.9.0 ; extra == 'production'
|
|
58
|
+
Requires-Dist: sentry-sdk >=1.0.0 ; extra == 'production'
|
|
59
|
+
|
|
60
|
+
# Setu TrafficMonitor
|
|
61
|
+
|
|
62
|
+
A comprehensive Django application for logging HTTP requests with a beautiful analytics dashboard. Monitor your API traffic, analyze performance metrics, and gain insights into your application's usage patterns.
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+

|
|
66
|
+

|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
### Request Logging
|
|
72
|
+
- **Comprehensive Logging**: Captures all HTTP requests with detailed information
|
|
73
|
+
- **Performance Metrics**: Track response times and database query counts
|
|
74
|
+
- **User Tracking**: Associate requests with authenticated users
|
|
75
|
+
- **IP Address Tracking**: Monitor requests by IP address with X-Forwarded-For support
|
|
76
|
+
- **Request/Response Bodies**: Store request and response payloads (with size limits)
|
|
77
|
+
- **Exception Tracking**: Automatic logging of exceptions with full tracebacks
|
|
78
|
+
- **Configurable Exclusions**: Exclude specific paths (static files, health checks, etc.)
|
|
79
|
+
|
|
80
|
+
### Analytics Dashboard
|
|
81
|
+
- **Real-time Visualizations**: Interactive charts powered by Chart.js
|
|
82
|
+
- **Time-based Analysis**: View metrics by today, last 7 days, last 30 days, or custom ranges
|
|
83
|
+
- **Status Code Distribution**: Track success rates and error patterns
|
|
84
|
+
- **HTTP Method Breakdown**: Analyze request types (GET, POST, PUT, DELETE, etc.)
|
|
85
|
+
- **Endpoint Performance**: Identify slowest endpoints and optimization opportunities
|
|
86
|
+
- **Hourly Heatmap**: Discover traffic patterns throughout the day
|
|
87
|
+
- **Top IPs & Users**: Monitor most active clients and users
|
|
88
|
+
- **Error Trending**: Track 4xx and 5xx errors over time
|
|
89
|
+
- **Advanced Filtering**: Filter by method, status code, path, and user
|
|
90
|
+
|
|
91
|
+
### REST API Endpoints
|
|
92
|
+
- **Analytics Overview API**: Get comprehensive analytics data in JSON format
|
|
93
|
+
- **Chart-specific APIs**: Fetch individual chart data for custom integrations
|
|
94
|
+
- **Admin-only Access**: Secure endpoints with Django permissions
|
|
95
|
+
|
|
96
|
+
## Installation
|
|
97
|
+
|
|
98
|
+
### Using pip
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
pip install <path-to-your-private-setu-trafficmonitor-package>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### From source
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone <internal-repo-url>
|
|
108
|
+
cd setu-trafficmonitor
|
|
109
|
+
pip install -e .
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Quick Start
|
|
113
|
+
|
|
114
|
+
### 1. Add to Installed Apps
|
|
115
|
+
|
|
116
|
+
Add `trafficmonitor` to your `INSTALLED_APPS` in `settings.py`:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
INSTALLED_APPS = [
|
|
120
|
+
# ... other apps
|
|
121
|
+
'rest_framework', # Required dependency
|
|
122
|
+
'trafficmonitor',
|
|
123
|
+
]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 2. Add Middleware
|
|
127
|
+
|
|
128
|
+
Add the middleware to your `MIDDLEWARE` setting (preferably near the top):
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
MIDDLEWARE = [
|
|
132
|
+
'django.middleware.security.SecurityMiddleware',
|
|
133
|
+
'trafficmonitor.middleware.RequestLoggingMiddleware', # Add here
|
|
134
|
+
# ... other middleware
|
|
135
|
+
]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 3. Configure URLs
|
|
139
|
+
|
|
140
|
+
Include the TrafficMonitor URLs in your project's `urls.py`:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from django.urls import path, include
|
|
144
|
+
|
|
145
|
+
urlpatterns = [
|
|
146
|
+
# ... your other URLs
|
|
147
|
+
path('', include('trafficmonitor.analytics.urls')),
|
|
148
|
+
]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 4. Run Migrations
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
python manage.py migrate trafficmonitor
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 5. Access the Dashboard
|
|
158
|
+
|
|
159
|
+
Start your development server and navigate to:
|
|
160
|
+
- **Dashboard**: `http://localhost:8000/analytics/dashboard/`
|
|
161
|
+
- **API Overview**: `http://localhost:8000/api/analytics/overview/`
|
|
162
|
+
|
|
163
|
+
**Note**: Dashboard access is restricted to staff users. Make sure you have a staff user:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
python manage.py createsuperuser
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Configuration
|
|
170
|
+
|
|
171
|
+
### Middleware Settings
|
|
172
|
+
|
|
173
|
+
You can customize the middleware behavior by subclassing and overriding:
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
from trafficmonitor.middleware import RequestLoggingMiddleware
|
|
177
|
+
|
|
178
|
+
class CustomRequestLoggingMiddleware(RequestLoggingMiddleware):
|
|
179
|
+
# Maximum body size to log (in characters)
|
|
180
|
+
MAX_BODY_LENGTH = 20000
|
|
181
|
+
|
|
182
|
+
# Paths to exclude from logging
|
|
183
|
+
EXCLUDED_PATHS = [
|
|
184
|
+
'/admin/jsi18n/',
|
|
185
|
+
'/static/',
|
|
186
|
+
'/media/',
|
|
187
|
+
'/__debug__/',
|
|
188
|
+
'/favicon.ico',
|
|
189
|
+
'/health/', # Add custom paths
|
|
190
|
+
]
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Then use your custom middleware in `settings.py`:
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
MIDDLEWARE = [
|
|
197
|
+
# ...
|
|
198
|
+
'myapp.middleware.CustomRequestLoggingMiddleware',
|
|
199
|
+
# ...
|
|
200
|
+
]
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Database Optimization
|
|
204
|
+
|
|
205
|
+
For high-traffic applications, consider:
|
|
206
|
+
|
|
207
|
+
1. **Database Indexing**: The package includes optimized indexes for common queries
|
|
208
|
+
2. **Partitioning**: Consider partitioning the `request_log` table by date
|
|
209
|
+
3. **Archiving**: Implement a cleanup strategy for old logs:
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
from django.utils import timezone
|
|
213
|
+
from datetime import timedelta
|
|
214
|
+
from trafficmonitor.models import RequestLog
|
|
215
|
+
|
|
216
|
+
# Delete logs older than 90 days
|
|
217
|
+
cutoff_date = timezone.now() - timedelta(days=90)
|
|
218
|
+
RequestLog.objects.filter(timestamp__lt=cutoff_date).delete()
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
4. **Read Replicas**: Route analytics queries to read replicas if available
|
|
222
|
+
|
|
223
|
+
## Usage Examples
|
|
224
|
+
|
|
225
|
+
### Accessing Analytics Data Programmatically
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
from trafficmonitor.analytics.views import AnalyticsQueryHelper
|
|
229
|
+
from django.utils import timezone
|
|
230
|
+
from datetime import timedelta
|
|
231
|
+
|
|
232
|
+
# Get date range
|
|
233
|
+
end_date = timezone.now()
|
|
234
|
+
start_date = end_date - timedelta(days=7)
|
|
235
|
+
|
|
236
|
+
# Get total requests
|
|
237
|
+
total = AnalyticsQueryHelper.get_total_requests(start_date, end_date)
|
|
238
|
+
|
|
239
|
+
# Get top endpoints
|
|
240
|
+
top_endpoints = AnalyticsQueryHelper.get_top_endpoints(
|
|
241
|
+
start_date, end_date, limit=10
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
# Get slowest endpoints
|
|
245
|
+
slow_endpoints = AnalyticsQueryHelper.get_slowest_endpoints(
|
|
246
|
+
start_date, end_date, limit=10
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
# Get comprehensive analytics
|
|
250
|
+
analytics = AnalyticsQueryHelper.get_comprehensive_analytics(
|
|
251
|
+
start_date, end_date
|
|
252
|
+
)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Filtering Analytics
|
|
256
|
+
|
|
257
|
+
```python
|
|
258
|
+
# Filter by HTTP method
|
|
259
|
+
get_requests = AnalyticsQueryHelper.get_total_requests(
|
|
260
|
+
start_date, end_date, method='GET'
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
# Filter by status code range
|
|
264
|
+
errors = AnalyticsQueryHelper.get_total_requests(
|
|
265
|
+
start_date, end_date, status_code_range=(400, 599)
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
# Filter by path
|
|
269
|
+
api_requests = AnalyticsQueryHelper.get_total_requests(
|
|
270
|
+
start_date, end_date, path_contains='/api/'
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
# Filter by user
|
|
274
|
+
user_requests = AnalyticsQueryHelper.get_total_requests(
|
|
275
|
+
start_date, end_date, user_id=user.id
|
|
276
|
+
)
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Custom Celery Task for Log Cleanup
|
|
280
|
+
|
|
281
|
+
```python
|
|
282
|
+
from celery import shared_task
|
|
283
|
+
from django.utils import timezone
|
|
284
|
+
from datetime import timedelta
|
|
285
|
+
from trafficmonitor.models import RequestLog
|
|
286
|
+
|
|
287
|
+
@shared_task
|
|
288
|
+
def cleanup_old_request_logs():
|
|
289
|
+
"""Delete request logs older than 90 days"""
|
|
290
|
+
cutoff_date = timezone.now() - timedelta(days=90)
|
|
291
|
+
deleted_count, _ = RequestLog.objects.filter(
|
|
292
|
+
timestamp__lt=cutoff_date
|
|
293
|
+
).delete()
|
|
294
|
+
return f"Deleted {deleted_count} old request logs"
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## API Reference
|
|
298
|
+
|
|
299
|
+
### REST API Endpoints
|
|
300
|
+
|
|
301
|
+
#### Analytics Overview
|
|
302
|
+
```
|
|
303
|
+
GET /api/analytics/overview/
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Query Parameters:
|
|
307
|
+
- `range`: `today`, `yesterday`, `last_7_days`, `last_30_days`, `custom`
|
|
308
|
+
- `start_date`: ISO format date (YYYY-MM-DD) for custom range
|
|
309
|
+
- `end_date`: ISO format date (YYYY-MM-DD) for custom range
|
|
310
|
+
- `method`: Filter by HTTP method (GET, POST, etc.)
|
|
311
|
+
- `status`: Filter by status code
|
|
312
|
+
- `path`: Filter by path contains
|
|
313
|
+
- `user`: Filter by user ID
|
|
314
|
+
|
|
315
|
+
#### Chart Data
|
|
316
|
+
```
|
|
317
|
+
GET /api/analytics/chart/<chart_type>/
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Chart Types:
|
|
321
|
+
- `time-series`: Requests over time
|
|
322
|
+
- `status-codes`: Status code distribution
|
|
323
|
+
- `methods`: HTTP methods breakdown
|
|
324
|
+
- `endpoints`: Top endpoints
|
|
325
|
+
- `performance`: Slowest endpoints
|
|
326
|
+
- `heatmap`: Hourly request heatmap
|
|
327
|
+
- `errors`: Error trend over time
|
|
328
|
+
|
|
329
|
+
## Database Schema
|
|
330
|
+
|
|
331
|
+
### RequestLog Model
|
|
332
|
+
|
|
333
|
+
| Field | Type | Description |
|
|
334
|
+
|-------|------|-------------|
|
|
335
|
+
| id | UUID | Primary key |
|
|
336
|
+
| method | CharField | HTTP method (GET, POST, etc.) |
|
|
337
|
+
| path | CharField | Request path/URL |
|
|
338
|
+
| full_url | TextField | Complete URL with query params |
|
|
339
|
+
| status_code | IntegerField | HTTP response status code |
|
|
340
|
+
| user | ForeignKey | Authenticated user (nullable) |
|
|
341
|
+
| ip_address | GenericIPAddressField | Client IP address |
|
|
342
|
+
| user_agent | TextField | User agent string |
|
|
343
|
+
| request_headers | JSONField | Request headers (sensitive ones excluded) |
|
|
344
|
+
| request_body | TextField | Request body (truncated) |
|
|
345
|
+
| response_body | TextField | Response body (truncated) |
|
|
346
|
+
| response_time_ms | FloatField | Response time in milliseconds |
|
|
347
|
+
| query_count | IntegerField | Database queries executed |
|
|
348
|
+
| exception | TextField | Exception traceback if failed |
|
|
349
|
+
| content_length | IntegerField | Response size in bytes |
|
|
350
|
+
| timestamp | DateTimeField | Request timestamp |
|
|
351
|
+
|
|
352
|
+
## Performance Considerations
|
|
353
|
+
|
|
354
|
+
- **Indexes**: The package includes optimized database indexes for common queries
|
|
355
|
+
- **Query Optimization**: Analytics queries use `select_related()` and `annotate()` for efficiency
|
|
356
|
+
- **Async Logging**: Consider implementing asynchronous logging for high-traffic applications
|
|
357
|
+
- **Body Truncation**: Request/response bodies are automatically truncated to prevent database bloat
|
|
358
|
+
- **Excluded Paths**: Static files and health checks are excluded by default
|
|
359
|
+
|
|
360
|
+
## Security
|
|
361
|
+
|
|
362
|
+
- **Sensitive Headers**: Authorization headers and cookies are automatically excluded from logging
|
|
363
|
+
- **Admin Access**: Dashboard and API endpoints require staff/admin permissions
|
|
364
|
+
- **User Authentication**: Built-in Django authentication and authorization
|
|
365
|
+
- **CSRF Protection**: Standard Django CSRF protection applies
|
|
366
|
+
|
|
367
|
+
## Contributing
|
|
368
|
+
|
|
369
|
+
Contributions are welcome! Please follow these steps:
|
|
370
|
+
|
|
371
|
+
1. Fork the repository
|
|
372
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
373
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
374
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
375
|
+
5. Open a Pull Request
|
|
376
|
+
|
|
377
|
+
## Versioning
|
|
378
|
+
|
|
379
|
+
This project uses [Semantic Versioning](https://semver.org/):
|
|
380
|
+
- **MAJOR** version for incompatible API changes
|
|
381
|
+
- **MINOR** version for backwards-compatible functionality additions
|
|
382
|
+
- **PATCH** version for backwards-compatible bug fixes
|
|
383
|
+
|
|
384
|
+
See [CHANGELOG.md](CHANGELOG.md) for version history.
|
|
385
|
+
|
|
386
|
+
## License
|
|
387
|
+
|
|
388
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
389
|
+
|
|
390
|
+
## Support
|
|
391
|
+
|
|
392
|
+
- **Issues**: [GitHub Issues](https://github.com/farmsetu/django-trafficmonitor/issues)
|
|
393
|
+
- **Documentation**: [GitHub Wiki](https://github.com/farmsetu/django-trafficmonitor/wiki)
|
|
394
|
+
|
|
395
|
+
## Credits
|
|
396
|
+
|
|
397
|
+
Developed by [FarmSetu Team](https://farmsetu.com)
|
|
398
|
+
|
|
399
|
+
## Changelog
|
|
400
|
+
|
|
401
|
+
See [CHANGELOG.md](CHANGELOG.md) for a detailed version history.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
trafficmonitor/__init__.py,sha256=R33H15TOYxh3ql2Jo9ow4Xo_DoW48cs31ZyN9oN2qxE,277
|
|
2
|
+
trafficmonitor/admin.py,sha256=yZDeH2jdA0X1RU6TTkYly-3DE7HG3X23d5-rGbxyzcw,6459
|
|
3
|
+
trafficmonitor/apps.py,sha256=pyeGnn-R9mU0jKZGd0FErJWZbURtpt0RO4q87HEsO9A,197
|
|
4
|
+
trafficmonitor/circuit_breaker.py,sha256=zSV8vcBQrQ6_xLb04yFKuo2qtvkogvuD4p2YFY5OIFs,1911
|
|
5
|
+
trafficmonitor/conf.py,sha256=lJfutySfKzhRpuBYN5c_UGqg0EogQ9GhWBZkS6WlNJQ,6164
|
|
6
|
+
trafficmonitor/dashboard_security.py,sha256=6_UAhXWKru3B165Dtgj96VOYQZG1J1Mf1lVYrm-GKWU,4106
|
|
7
|
+
trafficmonitor/db_utils.py,sha256=cS99U-vQqNhphxkuqH4KZq84xbs8vCRGGq45yBRSRkU,1240
|
|
8
|
+
trafficmonitor/exceptions.py,sha256=ZyPjQTpWXNAmtct8xJyFFsaitQBVffVlLx90P-KjzmM,2917
|
|
9
|
+
trafficmonitor/health.py,sha256=oM1rbbbKvkw2PryPTh8bRZ1ODj-1SyRWlv52DnoyWD4,2341
|
|
10
|
+
trafficmonitor/load_test.py,sha256=H8dkDY3w6w8TJ2izyNtUW2Qmk8bLP05Tl7CgLpH3xzA,15078
|
|
11
|
+
trafficmonitor/load_test_api.py,sha256=U1pRK8Gr-zlyP2UUNj6Z0yQx9XbVa0JywIfyYWsWJQc,11344
|
|
12
|
+
trafficmonitor/middleware.py,sha256=3QlN7jM8bdnSnBBiRWhxjdhmX9GzKMxwCXQ4Or6Z7xI,14827
|
|
13
|
+
trafficmonitor/models.py,sha256=pBMuyIM9vJJzDqWaJUavgP2Djp6-I7YVFba4rNjkjWE,7192
|
|
14
|
+
trafficmonitor/monitoring.py,sha256=NOJ_NUQZ-RDwhOVhhJ1CWx2FhdvfJXc0BkqqzKkCjoQ,3396
|
|
15
|
+
trafficmonitor/permissions.py,sha256=uXLHGCcnhhvAbEAUe2IAMDI3sjIIPbNk-Jogv1diA64,2242
|
|
16
|
+
trafficmonitor/security.py,sha256=EgM7LQwM1iuAzsE4ooPwgkq9fSy5Yh_bzFFgnDwz-Vs,6238
|
|
17
|
+
trafficmonitor/settings_production.py,sha256=7LNPqdx76hxxo7L6LjHaQ-lKpwgJ1cmkblPE6WeiSkQ,2842
|
|
18
|
+
trafficmonitor/tasks.py,sha256=IUDymluosGPB_qnxqRc92Zldviu2CWDogl_qe0szvug,4070
|
|
19
|
+
trafficmonitor/tests.py,sha256=dFKVE2esGrt-Hx8V_NROK2lR9Nh3DOKQAQzMzGnUkPo,8807
|
|
20
|
+
trafficmonitor/views.py,sha256=xc1IQHrsij7j33TUbo-_oewy3vs03pw_etpBWaMYJl0,63
|
|
21
|
+
trafficmonitor/websocket_consumers.py,sha256=tvrbt0QffAcv3ec8wTU56WBWLiNhGgF8DsVR6YwAYx0,4322
|
|
22
|
+
trafficmonitor/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
+
trafficmonitor/analytics/enhanced_queries.py,sha256=1NLHQ42o_-xZ45XMxvsnrad_YmxWcPuJWmgxM2dStdE,11768
|
|
24
|
+
trafficmonitor/analytics/serializers.py,sha256=cAge57F9328OSC0woUZ39vNH4mQMpZolSfcfgl04pXQ,6966
|
|
25
|
+
trafficmonitor/analytics/tests.py,sha256=lNIG1u6NN_sDy9VecJJ9wkPNLfNO1sNHWYJzyiS5Ofk,25463
|
|
26
|
+
trafficmonitor/analytics/urls.py,sha256=5f-WBeyU5dc_oifhRevFckYvTD7avb1ddUteUOYv_B8,514
|
|
27
|
+
trafficmonitor/analytics/views.py,sha256=QSxyFzGSiNK2sP8Ra7BrmvwRud-qFbEhkSY4KNzgloM,24311
|
|
28
|
+
trafficmonitor/management/__init__.py,sha256=1qi5wv2KVLIKoGVzItrB78D8xrbf3ruwO3_kGZ7bLh4,30
|
|
29
|
+
trafficmonitor/management/commands/__init__.py,sha256=1pri3qN5PLFIRSwxLkZJ7Bc4W4UyiKBZCcJjqy1IUr0,22
|
|
30
|
+
trafficmonitor/management/commands/cleanup_request_logs.py,sha256=EvcNlipAz8uwaPCFbsr3n4iwyVrfTCR1wGeGCu8MGMQ,2480
|
|
31
|
+
trafficmonitor/migrations/0001_initial.py,sha256=y4bUcm5SHhtN5Ema4u10KZjjAjwz4DXuOTMq2qjETqg,5411
|
|
32
|
+
trafficmonitor/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
+
trafficmonitor/static/analytics/css/dashboard.css,sha256=_H1mlAc9wH3-xlja1HGYw9HKYZtijH7abkPM7qc7A4s,1911
|
|
34
|
+
trafficmonitor/static/analytics/js/dashboard-production.js,sha256=aRGgAEB7SGcZ5wBVj9G4FKwUl-t6GxxsdFDayDRw-6o,10542
|
|
35
|
+
trafficmonitor/static/analytics/js/dashboard-v2.js,sha256=hZO1mUmdZK3YfCYLVX5ToaeWBfN_zPEE_T6e08fMEQM,21880
|
|
36
|
+
trafficmonitor/static/analytics/js/dashboard.js,sha256=t-VfdUi8f2Bil6mIAeI-YmyBg0mMyAt5PigjQ7-I5Eo,20022
|
|
37
|
+
trafficmonitor/templates/analytics/dashboard.html,sha256=O1vZR3oE7_19PSyrQ-GqehGWIDb7FTCcT22x60iYHio,24159
|
|
38
|
+
setu_trafficmonitor-2.0.0.dist-info/LICENSE,sha256=UfMLKswUDNhVdUu-ul480Q3ei7XGfX_9uuAxK7OdWU4,1070
|
|
39
|
+
setu_trafficmonitor-2.0.0.dist-info/METADATA,sha256=nzFDdITkS_2k5SjXqvbjmTabUmPqxE-YDUkIdkTntUA,12979
|
|
40
|
+
setu_trafficmonitor-2.0.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
41
|
+
setu_trafficmonitor-2.0.0.dist-info/top_level.txt,sha256=81-5rK9eQL1OP2I-aXy5Nd7fw7gHRKYsOfPMN2tVpVE,15
|
|
42
|
+
setu_trafficmonitor-2.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
trafficmonitor
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Django TrafficMonitor
|
|
3
|
+
A comprehensive Django app for logging HTTP requests with analytics dashboard
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__version__ = '1.1.0'
|
|
7
|
+
__author__ = 'FarmSetu Team'
|
|
8
|
+
__email__ = 'tech@farmsetu.com'
|
|
9
|
+
__license__ = 'MIT'
|
|
10
|
+
|
|
11
|
+
default_app_config = 'trafficmonitor.apps.TrafficmonitorConfig'
|