Move monitoring from common to openedx/core
This commit is contained in:
@@ -868,7 +868,7 @@ INSTALLED_APPS = (
|
||||
'embargo',
|
||||
|
||||
# Monitoring signals
|
||||
'monitoring',
|
||||
'openedx.core.djangoapps.monitoring',
|
||||
|
||||
# Course action state
|
||||
'course_action_state',
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# Register signal handlers
|
||||
# pylint: disable=unused-import
|
||||
import signals
|
||||
import exceptions
|
||||
@@ -2010,7 +2010,7 @@ INSTALLED_APPS = (
|
||||
'embargo',
|
||||
|
||||
# Monitoring functionality
|
||||
'monitoring',
|
||||
'openedx.core.djangoapps.monitoring',
|
||||
|
||||
# Course action state
|
||||
'course_action_state',
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
"""
|
||||
Signal handler for exceptions.
|
||||
"""
|
||||
from django.core.signals import got_request_exception
|
||||
from django.dispatch import receiver
|
||||
import logging
|
||||
|
||||
|
||||
@receiver(got_request_exception)
|
||||
def record_request_exception(sender, **kwargs):
|
||||
def record_request_exception(sender, **kwargs): # pylint: disable=unused-argument
|
||||
"""
|
||||
Logs the stack trace whenever an exception
|
||||
occurs in processing a request.
|
||||
"""
|
||||
logging.exception("Uncaught exception from {sender}".format(
|
||||
sender=sender
|
||||
))
|
||||
@@ -13,7 +13,7 @@ from django.dispatch import receiver
|
||||
import dogstats_wrapper as dog_stats_api
|
||||
|
||||
|
||||
def _database_tags(action, sender, kwargs):
|
||||
def _database_tags(action, sender, kwargs): # pylint: disable=unused-argument
|
||||
"""
|
||||
Return a tags for the sender and database used in django.db.models signals.
|
||||
|
||||
6
openedx/core/djangoapps/monitoring/startup.py
Normal file
6
openedx/core/djangoapps/monitoring/startup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
"""
|
||||
Registers signal handlers at startup.
|
||||
"""
|
||||
# pylint: disable=unused-import
|
||||
import openedx.core.djangoapps.monitoring.signals
|
||||
import openedx.core.djangoapps.monitoring.exceptions
|
||||
Reference in New Issue
Block a user