[monitoring] Prometheus database monitoring only compatible with MySql
@@ -697,6 +697,7 @@ if desktop.conf.ENABLE_PROMETHEUS.get():
MIDDLEWARE_CLASSES.insert(0, 'django_prometheus.middleware.PrometheusBeforeMiddleware')
MIDDLEWARE_CLASSES.append('django_prometheus.middleware.PrometheusAfterMiddleware')
+ if 'mysql' in DATABASES['default']['ENGINE']:
DATABASES['default']['ENGINE'] = DATABASES['default']['ENGINE'].replace('django.db.backends', 'django_prometheus.db.backends')
for name, val in CACHES.items():
val['BACKEND'] = val['BACKEND'].replace('django.core.cache.backends', 'django_prometheus.cache.backends')
