Skip to content

Commit

Permalink
- Improve Monitoring Request Filter Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Jul 9, 2019
1 parent 4c7ac25 commit 068ac0b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion geonode/monitoring/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@
from django.http import HttpResponse


FILTER_URLS = (settings.MEDIA_URL, settings.STATIC_URL, '/admin/jsi18n/',)
FILTER_URLS = (settings.MEDIA_URL,
settings.STATIC_URL,
'/gs/',
'/api/',
'/security/',
'/lang.js',
'/jsi18n/',
'/h_keywords_api',
'/admin/jsi18n/',)


class MonitoringMiddleware(object):
Expand Down
1 change: 1 addition & 0 deletions geonode/monitoring/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def get_cpu():
cpu = psutil.cpu_times()
return {
'usage': cpu.user + cpu.system,
'usage.percent': psutil.cpu_percent()
}

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions geonode/monitoring/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@


class MonitoringFilter(logging.Filter):

def __init__(self, service, skip_urls=tuple(), *args, **kwargs):
super(MonitoringFilter, self).__init__(*args, **kwargs)
self.service = service
Expand Down
1 change: 1 addition & 0 deletions geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@
'%s/api/adminRole' % FORCE_SCRIPT_NAME,
'%s/api/users' % FORCE_SCRIPT_NAME,
'%s/api/layers' % FORCE_SCRIPT_NAME,
'%s/monitoring' % FORCE_SCRIPT_NAME,
)

ANONYMOUS_USER_ID = os.getenv('ANONYMOUS_USER_ID', '-1')
Expand Down

0 comments on commit 068ac0b

Please sign in to comment.