File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 5858 be useful if you want to use the Django integration, but you want to trace only
5959 particular functions or views. If set to False, the request middleware will be
6060 disabled even if present.
61+ * ``DATABASE_AUTO_INSTRUMENT`` (default: ``True``): if set to false database will not
62+ be instrumented. Only is configurable when ``AUTO_INSTRUMENT`` is set to true.
63+ * ``CACHE_AUTO_INSTRUMENT`` (default: ``True``): if set to false cache will not
64+ be instrumented. Only is configurable when ``AUTO_INSTRUMENT`` is set to true.
6165* ``AGENT_HOSTNAME`` (default: ``localhost``): define the hostname of the trace agent.
6266* ``AGENT_PORT`` (default: ``8126``): define the port of the trace agent.
6367"""
Original file line number Diff line number Diff line change @@ -49,17 +49,20 @@ def ready(self):
4949 if settings .AUTO_INSTRUMENT :
5050 # trace Django internals
5151 insert_exception_middleware ()
52- try :
53- patch_db (tracer )
54- except Exception :
55- log .exception ('error patching Django database connections' )
5652
5753 try :
5854 patch_template (tracer )
5955 except Exception :
6056 log .exception ('error patching Django template rendering' )
6157
62- try :
63- patch_cache (tracer )
64- except Exception :
65- log .exception ('error patching Django cache' )
58+ if settings .DATABASE_AUTO_INSTRUMENT :
59+ try :
60+ patch_db (tracer )
61+ except Exception :
62+ log .exception ('error patching Django database connections' )
63+
64+ if settings .CACHE_AUTO_INSTRUMENT :
65+ try :
66+ patch_cache (tracer )
67+ except Exception :
68+ log .exception ('error patching Django cache' )
Original file line number Diff line number Diff line change 2525 'AGENT_HOSTNAME' : 'localhost' ,
2626 'AGENT_PORT' : 8126 ,
2727 'AUTO_INSTRUMENT' : True ,
28+ 'DATABASE_AUTO_INSTRUMENT' : True ,
29+ 'CACHE_AUTO_INSTRUMENT' : True ,
2830 'DEFAULT_DATABASE_PREFIX' : '' ,
2931 'DEFAULT_SERVICE' : 'django' ,
3032 'ENABLED' : True ,
You can’t perform that action at this time.
0 commit comments