django-prometheus 2.6.0.dev19__tar.gz → 2.6.0.dev20__tar.gz

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.
Files changed (50) hide show
  1. {django_prometheus-2.6.0.dev19/django_prometheus.egg-info → django_prometheus-2.6.0.dev20}/PKG-INFO +56 -17
  2. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/README.md +55 -16
  3. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/__init__.py +1 -1
  4. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20/django_prometheus.egg-info}/PKG-INFO +56 -17
  5. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/LICENSE +0 -0
  6. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/MANIFEST.in +0 -0
  7. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/apps.py +0 -0
  8. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/cache/__init__.py +0 -0
  9. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/cache/backends/__init__.py +0 -0
  10. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/cache/backends/django_memcached_consul.py +0 -0
  11. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/cache/backends/filebased.py +0 -0
  12. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/cache/backends/locmem.py +0 -0
  13. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/cache/backends/memcached.py +0 -0
  14. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/cache/backends/redis.py +0 -0
  15. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/cache/metrics.py +0 -0
  16. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/conf/__init__.py +0 -0
  17. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/__init__.py +0 -0
  18. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/__init__.py +0 -0
  19. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/mysql/__init__.py +0 -0
  20. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/mysql/base.py +0 -0
  21. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/postgis/__init__.py +0 -0
  22. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/postgis/base.py +0 -0
  23. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/postgresql/__init__.py +0 -0
  24. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/postgresql/base.py +0 -0
  25. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/spatialite/__init__.py +0 -0
  26. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/spatialite/base.py +0 -0
  27. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/sqlite3/__init__.py +0 -0
  28. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/backends/sqlite3/base.py +0 -0
  29. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/common.py +0 -0
  30. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/db/metrics.py +0 -0
  31. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/exports.py +0 -0
  32. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/middleware.py +0 -0
  33. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/migrations.py +0 -0
  34. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/models.py +0 -0
  35. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/tests/__init__.py +0 -0
  36. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/tests/test_db_wrapper.py +0 -0
  37. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/tests/test_django_prometheus.py +0 -0
  38. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/tests/test_exports.py +0 -0
  39. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/tests/test_testutils.py +0 -0
  40. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/tests/test_utils.py +0 -0
  41. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/testutils.py +0 -0
  42. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/urls.py +0 -0
  43. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus/utils.py +0 -0
  44. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus.egg-info/SOURCES.txt +0 -0
  45. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus.egg-info/dependency_links.txt +0 -0
  46. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus.egg-info/requires.txt +0 -0
  47. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/django_prometheus.egg-info/top_level.txt +0 -0
  48. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/pyproject.toml +0 -0
  49. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/setup.cfg +0 -0
  50. {django_prometheus-2.6.0.dev19 → django_prometheus-2.6.0.dev20}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-prometheus
3
- Version: 2.6.0.dev19
3
+ Version: 2.6.0.dev20
4
4
  Summary: Django middlewares to monitor your application with Prometheus.io.
5
5
  Home-page: http://github.com/korfuri/django-prometheus
6
6
  Author: Uriel Corfa
@@ -117,14 +117,51 @@ Prometheus uses Histogram based grouping for monitoring latencies. The default
117
117
  buckets are:
118
118
 
119
119
  ```python
120
- PROMETHEUS_LATENCY_BUCKETS = (0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, 25.0, 50.0, 75.0, float("inf"),)
120
+ PROMETHEUS_LATENCY_BUCKETS = (
121
+ 0.01,
122
+ 0.025,
123
+ 0.05,
124
+ 0.075,
125
+ 0.1,
126
+ 0.25,
127
+ 0.5,
128
+ 0.75,
129
+ 1.0,
130
+ 2.5,
131
+ 5.0,
132
+ 7.5,
133
+ 10.0,
134
+ 25.0,
135
+ 50.0,
136
+ 75.0,
137
+ float("inf"),
138
+ )
121
139
  ```
122
140
 
123
141
  You can define custom buckets for latency, adding more buckets decreases performance but
124
142
  increases accuracy: <https://prometheus.io/docs/practices/histograms/>
125
143
 
126
144
  ```python
127
- PROMETHEUS_LATENCY_BUCKETS = (.1, .2, .5, .6, .8, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.5, 9.0, 12.0, 15.0, 20.0, 30.0, float("inf"))
145
+ PROMETHEUS_LATENCY_BUCKETS = (
146
+ 0.1,
147
+ 0.2,
148
+ 0.5,
149
+ 0.6,
150
+ 0.8,
151
+ 1.0,
152
+ 2.0,
153
+ 3.0,
154
+ 4.0,
155
+ 5.0,
156
+ 6.0,
157
+ 7.5,
158
+ 9.0,
159
+ 12.0,
160
+ 15.0,
161
+ 20.0,
162
+ 30.0,
163
+ float("inf"),
164
+ )
128
165
  ```
129
166
 
130
167
  ---
@@ -149,9 +186,9 @@ replace the `ENGINE` property of your database, replacing
149
186
 
150
187
  ```python
151
188
  DATABASES = {
152
- 'default': {
153
- 'ENGINE': 'django_prometheus.db.backends.sqlite3',
154
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
189
+ "default": {
190
+ "ENGINE": "django_prometheus.db.backends.sqlite3",
191
+ "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
155
192
  },
156
193
  }
157
194
  ```
@@ -164,9 +201,9 @@ the cache backend to use the one provided by django_prometheus
164
201
 
165
202
  ```python
166
203
  CACHES = {
167
- 'default': {
168
- 'BACKEND': 'django_prometheus.cache.backends.filebased.FileBasedCache',
169
- 'LOCATION': '/var/tmp/django_cache',
204
+ "default": {
205
+ "BACKEND": "django_prometheus.cache.backends.filebased.FileBasedCache",
206
+ "LOCATION": "/var/tmp/django_cache",
170
207
  }
171
208
  }
172
209
  ```
@@ -191,7 +228,8 @@ Just add the `ExportModelOperationsMixin` as such:
191
228
  ```python
192
229
  from django_prometheus.models import ExportModelOperationsMixin
193
230
 
194
- class Dog(ExportModelOperationsMixin('dog'), models.Model):
231
+
232
+ class Dog(ExportModelOperationsMixin("dog"), models.Model):
195
233
  name = models.CharField(max_length=100, unique=True)
196
234
  breed = models.CharField(max_length=100, blank=True, null=True)
197
235
  age = models.PositiveIntegerField(blank=True, null=True)
@@ -246,12 +284,13 @@ First step is to inject prometheus' middlewares and to add
246
284
  django_prometheus in INSTALLED_APPS
247
285
 
248
286
  ```python
249
- MIDDLEWARE = \
250
- ['django_prometheus.middleware.PrometheusBeforeMiddleware'] + \
251
- MIDDLEWARE + \
252
- ['django_prometheus.middleware.PrometheusAfterMiddleware']
287
+ MIDDLEWARE = (
288
+ ["django_prometheus.middleware.PrometheusBeforeMiddleware"]
289
+ + MIDDLEWARE
290
+ + ["django_prometheus.middleware.PrometheusAfterMiddleware"]
291
+ )
253
292
 
254
- INSTALLED_APPS += ['django_prometheus']
293
+ INSTALLED_APPS += ["django_prometheus"]
255
294
  ```
256
295
 
257
296
  Second step is to create the /metrics end point, for that we need
@@ -264,8 +303,8 @@ from django.urls import include, path
264
303
 
265
304
  urlpatterns = []
266
305
 
267
- urlpatterns.append(path('prometheus/', include('django_prometheus.urls')))
268
- urlpatterns.append(path('', include('myapp.urls')))
306
+ urlpatterns.append(path("prometheus/", include("django_prometheus.urls")))
307
+ urlpatterns.append(path("", include("myapp.urls")))
269
308
  ```
270
309
 
271
310
  This file will add a "/prometheus/metrics" end point to the URLs of django
@@ -80,14 +80,51 @@ Prometheus uses Histogram based grouping for monitoring latencies. The default
80
80
  buckets are:
81
81
 
82
82
  ```python
83
- PROMETHEUS_LATENCY_BUCKETS = (0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, 25.0, 50.0, 75.0, float("inf"),)
83
+ PROMETHEUS_LATENCY_BUCKETS = (
84
+ 0.01,
85
+ 0.025,
86
+ 0.05,
87
+ 0.075,
88
+ 0.1,
89
+ 0.25,
90
+ 0.5,
91
+ 0.75,
92
+ 1.0,
93
+ 2.5,
94
+ 5.0,
95
+ 7.5,
96
+ 10.0,
97
+ 25.0,
98
+ 50.0,
99
+ 75.0,
100
+ float("inf"),
101
+ )
84
102
  ```
85
103
 
86
104
  You can define custom buckets for latency, adding more buckets decreases performance but
87
105
  increases accuracy: <https://prometheus.io/docs/practices/histograms/>
88
106
 
89
107
  ```python
90
- PROMETHEUS_LATENCY_BUCKETS = (.1, .2, .5, .6, .8, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.5, 9.0, 12.0, 15.0, 20.0, 30.0, float("inf"))
108
+ PROMETHEUS_LATENCY_BUCKETS = (
109
+ 0.1,
110
+ 0.2,
111
+ 0.5,
112
+ 0.6,
113
+ 0.8,
114
+ 1.0,
115
+ 2.0,
116
+ 3.0,
117
+ 4.0,
118
+ 5.0,
119
+ 6.0,
120
+ 7.5,
121
+ 9.0,
122
+ 12.0,
123
+ 15.0,
124
+ 20.0,
125
+ 30.0,
126
+ float("inf"),
127
+ )
91
128
  ```
92
129
 
93
130
  ---
@@ -112,9 +149,9 @@ replace the `ENGINE` property of your database, replacing
112
149
 
113
150
  ```python
114
151
  DATABASES = {
115
- 'default': {
116
- 'ENGINE': 'django_prometheus.db.backends.sqlite3',
117
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
152
+ "default": {
153
+ "ENGINE": "django_prometheus.db.backends.sqlite3",
154
+ "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
118
155
  },
119
156
  }
120
157
  ```
@@ -127,9 +164,9 @@ the cache backend to use the one provided by django_prometheus
127
164
 
128
165
  ```python
129
166
  CACHES = {
130
- 'default': {
131
- 'BACKEND': 'django_prometheus.cache.backends.filebased.FileBasedCache',
132
- 'LOCATION': '/var/tmp/django_cache',
167
+ "default": {
168
+ "BACKEND": "django_prometheus.cache.backends.filebased.FileBasedCache",
169
+ "LOCATION": "/var/tmp/django_cache",
133
170
  }
134
171
  }
135
172
  ```
@@ -154,7 +191,8 @@ Just add the `ExportModelOperationsMixin` as such:
154
191
  ```python
155
192
  from django_prometheus.models import ExportModelOperationsMixin
156
193
 
157
- class Dog(ExportModelOperationsMixin('dog'), models.Model):
194
+
195
+ class Dog(ExportModelOperationsMixin("dog"), models.Model):
158
196
  name = models.CharField(max_length=100, unique=True)
159
197
  breed = models.CharField(max_length=100, blank=True, null=True)
160
198
  age = models.PositiveIntegerField(blank=True, null=True)
@@ -209,12 +247,13 @@ First step is to inject prometheus' middlewares and to add
209
247
  django_prometheus in INSTALLED_APPS
210
248
 
211
249
  ```python
212
- MIDDLEWARE = \
213
- ['django_prometheus.middleware.PrometheusBeforeMiddleware'] + \
214
- MIDDLEWARE + \
215
- ['django_prometheus.middleware.PrometheusAfterMiddleware']
250
+ MIDDLEWARE = (
251
+ ["django_prometheus.middleware.PrometheusBeforeMiddleware"]
252
+ + MIDDLEWARE
253
+ + ["django_prometheus.middleware.PrometheusAfterMiddleware"]
254
+ )
216
255
 
217
- INSTALLED_APPS += ['django_prometheus']
256
+ INSTALLED_APPS += ["django_prometheus"]
218
257
  ```
219
258
 
220
259
  Second step is to create the /metrics end point, for that we need
@@ -227,8 +266,8 @@ from django.urls import include, path
227
266
 
228
267
  urlpatterns = []
229
268
 
230
- urlpatterns.append(path('prometheus/', include('django_prometheus.urls')))
231
- urlpatterns.append(path('', include('myapp.urls')))
269
+ urlpatterns.append(path("prometheus/", include("django_prometheus.urls")))
270
+ urlpatterns.append(path("", include("myapp.urls")))
232
271
  ```
233
272
 
234
273
  This file will add a "/prometheus/metrics" end point to the URLs of django
@@ -10,7 +10,7 @@ from django_prometheus import middleware, models
10
10
 
11
11
  __all__ = ["middleware", "models", "pip_prometheus"]
12
12
 
13
- __version__ = "2.6.0.dev19"
13
+ __version__ = "2.6.0.dev20"
14
14
 
15
15
 
16
16
  # Import pip_prometheus to export the pip metrics automatically.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-prometheus
3
- Version: 2.6.0.dev19
3
+ Version: 2.6.0.dev20
4
4
  Summary: Django middlewares to monitor your application with Prometheus.io.
5
5
  Home-page: http://github.com/korfuri/django-prometheus
6
6
  Author: Uriel Corfa
@@ -117,14 +117,51 @@ Prometheus uses Histogram based grouping for monitoring latencies. The default
117
117
  buckets are:
118
118
 
119
119
  ```python
120
- PROMETHEUS_LATENCY_BUCKETS = (0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, 25.0, 50.0, 75.0, float("inf"),)
120
+ PROMETHEUS_LATENCY_BUCKETS = (
121
+ 0.01,
122
+ 0.025,
123
+ 0.05,
124
+ 0.075,
125
+ 0.1,
126
+ 0.25,
127
+ 0.5,
128
+ 0.75,
129
+ 1.0,
130
+ 2.5,
131
+ 5.0,
132
+ 7.5,
133
+ 10.0,
134
+ 25.0,
135
+ 50.0,
136
+ 75.0,
137
+ float("inf"),
138
+ )
121
139
  ```
122
140
 
123
141
  You can define custom buckets for latency, adding more buckets decreases performance but
124
142
  increases accuracy: <https://prometheus.io/docs/practices/histograms/>
125
143
 
126
144
  ```python
127
- PROMETHEUS_LATENCY_BUCKETS = (.1, .2, .5, .6, .8, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.5, 9.0, 12.0, 15.0, 20.0, 30.0, float("inf"))
145
+ PROMETHEUS_LATENCY_BUCKETS = (
146
+ 0.1,
147
+ 0.2,
148
+ 0.5,
149
+ 0.6,
150
+ 0.8,
151
+ 1.0,
152
+ 2.0,
153
+ 3.0,
154
+ 4.0,
155
+ 5.0,
156
+ 6.0,
157
+ 7.5,
158
+ 9.0,
159
+ 12.0,
160
+ 15.0,
161
+ 20.0,
162
+ 30.0,
163
+ float("inf"),
164
+ )
128
165
  ```
129
166
 
130
167
  ---
@@ -149,9 +186,9 @@ replace the `ENGINE` property of your database, replacing
149
186
 
150
187
  ```python
151
188
  DATABASES = {
152
- 'default': {
153
- 'ENGINE': 'django_prometheus.db.backends.sqlite3',
154
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
189
+ "default": {
190
+ "ENGINE": "django_prometheus.db.backends.sqlite3",
191
+ "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
155
192
  },
156
193
  }
157
194
  ```
@@ -164,9 +201,9 @@ the cache backend to use the one provided by django_prometheus
164
201
 
165
202
  ```python
166
203
  CACHES = {
167
- 'default': {
168
- 'BACKEND': 'django_prometheus.cache.backends.filebased.FileBasedCache',
169
- 'LOCATION': '/var/tmp/django_cache',
204
+ "default": {
205
+ "BACKEND": "django_prometheus.cache.backends.filebased.FileBasedCache",
206
+ "LOCATION": "/var/tmp/django_cache",
170
207
  }
171
208
  }
172
209
  ```
@@ -191,7 +228,8 @@ Just add the `ExportModelOperationsMixin` as such:
191
228
  ```python
192
229
  from django_prometheus.models import ExportModelOperationsMixin
193
230
 
194
- class Dog(ExportModelOperationsMixin('dog'), models.Model):
231
+
232
+ class Dog(ExportModelOperationsMixin("dog"), models.Model):
195
233
  name = models.CharField(max_length=100, unique=True)
196
234
  breed = models.CharField(max_length=100, blank=True, null=True)
197
235
  age = models.PositiveIntegerField(blank=True, null=True)
@@ -246,12 +284,13 @@ First step is to inject prometheus' middlewares and to add
246
284
  django_prometheus in INSTALLED_APPS
247
285
 
248
286
  ```python
249
- MIDDLEWARE = \
250
- ['django_prometheus.middleware.PrometheusBeforeMiddleware'] + \
251
- MIDDLEWARE + \
252
- ['django_prometheus.middleware.PrometheusAfterMiddleware']
287
+ MIDDLEWARE = (
288
+ ["django_prometheus.middleware.PrometheusBeforeMiddleware"]
289
+ + MIDDLEWARE
290
+ + ["django_prometheus.middleware.PrometheusAfterMiddleware"]
291
+ )
253
292
 
254
- INSTALLED_APPS += ['django_prometheus']
293
+ INSTALLED_APPS += ["django_prometheus"]
255
294
  ```
256
295
 
257
296
  Second step is to create the /metrics end point, for that we need
@@ -264,8 +303,8 @@ from django.urls import include, path
264
303
 
265
304
  urlpatterns = []
266
305
 
267
- urlpatterns.append(path('prometheus/', include('django_prometheus.urls')))
268
- urlpatterns.append(path('', include('myapp.urls')))
306
+ urlpatterns.append(path("prometheus/", include("django_prometheus.urls")))
307
+ urlpatterns.append(path("", include("myapp.urls")))
269
308
  ```
270
309
 
271
310
  This file will add a "/prometheus/metrics" end point to the URLs of django