whatap-python 1.8.1__tar.gz → 1.8.3__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.
Potentially problematic release.
This version of whatap-python might be problematic. Click here for more details.
- {whatap_python-1.8.1 → whatap_python-1.8.3}/PKG-INFO +1 -1
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/__init__.py +27 -14
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/agent/linux/amd64/whatap_python +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/agent/linux/arm64/whatap_python +0 -0
- whatap_python-1.8.3/whatap/build.py +4 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_fastapi.py +1 -1
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_flask.py +11 -7
- whatap_python-1.8.3/whatap/trace/mod/application_odoo.py +59 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_wsgi.py +6 -5
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/database_toolkit.py +8 -1
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/trace_module_definition.py +3 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap_python.egg-info/PKG-INFO +1 -1
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap_python.egg-info/SOURCES.txt +1 -0
- whatap_python-1.8.1/whatap/build.py +0 -4
- {whatap_python-1.8.1 → whatap_python-1.8.3}/README.md +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/setup.cfg +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/setup.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/LICENSE +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/README.rst +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/__main__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/agent/darwin/amd64/whatap_python +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/agent/darwin/arm64/whatap_python +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/bootstrap/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/bootstrap/sitecustomize.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/conf/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/conf/configuration.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/conf/configure.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/conf/license.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/control/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/counter/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/counter/counter_manager.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/counter/tasks/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/counter/tasks/openfiledescriptor.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/io/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/io/data_inputx.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/io/data_outputx.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/net/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/net/async_sender.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/net/packet_enum.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/net/packet_type_enum.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/net/param_def.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/net/stackhelper.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/net/udp_session.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/net/udp_thread.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/pack/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/pack/logSinkPack.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/pack/pack.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/pack/pack_enum.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/pack/tagCountPack.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/scripts/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/amqp_kombu.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/amqp_pika.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_bottle.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_celery.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_cherrypy.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_django.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_django_asgi.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_django_py3.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_frappe.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_graphql.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_nameko.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_starlette.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/application_tornado.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/database_cxoracle.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/database_mongo.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/database_mysql.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/database_postgresql.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/database_redis.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/email_smtp.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/httpc_django.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/httpc_httplib.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/httpc_requests.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/httpc_urllib3.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/logging.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/mod/plugin.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/simple_trace_context.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/trace_context.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/trace_context_manager.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/trace/trace_import.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/bit_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/cardinality/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/cardinality/hyperloglog.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/cardinality/murmurhash.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/cardinality/registerset.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/compare_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/date_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/debug_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/escape_literal_sql.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/hash_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/hexa32.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/int_set.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/ip_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/keygen.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/linked_list.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/linked_map.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/metering_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/request_double_queue.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/request_queue.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/string_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/throttle_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/util/userid_util.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/__init__.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/blob_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/boolean_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/decimal_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/double_summary.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/double_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/float_array.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/float_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/int_array.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/ip4_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/list_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/long_array.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/long_summary.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/map_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/null_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/number_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/summary_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/text_array.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/text_hash_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/text_value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/value.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/value/value_enum.py +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap/whatap.conf +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap_python.egg-info/dependency_links.txt +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap_python.egg-info/entry_points.txt +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap_python.egg-info/not-zip-safe +0 -0
- {whatap_python-1.8.1 → whatap_python-1.8.3}/whatap_python.egg-info/top_level.txt +0 -0
|
@@ -8,7 +8,6 @@ from whatap import build
|
|
|
8
8
|
from whatap.util.date_util import DateUtil
|
|
9
9
|
import threading
|
|
10
10
|
import builtins
|
|
11
|
-
import configparser
|
|
12
11
|
|
|
13
12
|
__version__ = build.version
|
|
14
13
|
|
|
@@ -49,19 +48,33 @@ LOG_FILE_NAME = 'whatap-hook.log'
|
|
|
49
48
|
|
|
50
49
|
isFrappeCommands = "get-frappe-commands" in sys.argv if hasattr(sys, "argv") else False
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
def read_ignore_whatap_stdout():
|
|
52
|
+
ignore_whatap_stdout = 'false'
|
|
53
|
+
home = os.environ.get('WHATAP_HOME', '.')
|
|
54
|
+
whatap_config = os.path.join(home, 'whatap.conf')
|
|
55
|
+
try:
|
|
56
|
+
with open(whatap_config) as f:
|
|
57
|
+
for raw in f:
|
|
58
|
+
line = raw.strip()
|
|
59
|
+
if not line or line.startswith('#'):
|
|
60
|
+
continue
|
|
61
|
+
if line.startswith('ignore_whatap_stdout'):
|
|
62
|
+
parts = line.split('=', 1)
|
|
63
|
+
if len(parts) == 2:
|
|
64
|
+
ignore_whatap_stdout = parts[1].strip()
|
|
65
|
+
break
|
|
66
|
+
return ignore_whatap_stdout
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
print('WHATAP : WHATAP.CONF READ ERROR')
|
|
68
|
+
except FileNotFoundError:
|
|
69
|
+
return ignore_whatap_stdout
|
|
70
|
+
|
|
71
|
+
except Exception as e:
|
|
72
|
+
print(f'WHATAP: config parse error ({e!r})')
|
|
73
|
+
return ignore_whatap_stdout
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
ignore_whatap_stdout = read_ignore_whatap_stdout()
|
|
65
78
|
|
|
66
79
|
|
|
67
80
|
|
|
@@ -70,7 +83,7 @@ original_print = builtins.print
|
|
|
70
83
|
def print_option(func):
|
|
71
84
|
def wrapper(*args, **kwargs):
|
|
72
85
|
|
|
73
|
-
if(
|
|
86
|
+
if(ignore_whatap_stdout == 'false'):
|
|
74
87
|
result = func(*args, **kwargs)
|
|
75
88
|
else:
|
|
76
89
|
result = None
|
|
Binary file
|
|
Binary file
|
|
@@ -310,8 +310,8 @@ async def interceptor_async(fn, dependant, *args, **kwargs):
|
|
|
310
310
|
callback = None
|
|
311
311
|
|
|
312
312
|
try:
|
|
313
|
-
callback = await fn(*args, **kwargs)
|
|
314
313
|
from fastapi.responses import StreamingResponse
|
|
314
|
+
callback = await fn(*args, **kwargs)
|
|
315
315
|
ctx = TraceContextManager.getLocalContext()
|
|
316
316
|
|
|
317
317
|
if isinstance(callback, StreamingResponse) and hasattr(callback, "body_iterator"):
|
|
@@ -26,21 +26,25 @@ def instrument(module):
|
|
|
26
26
|
def wrapper(fn):
|
|
27
27
|
@trace_handler(fn)
|
|
28
28
|
def trace(*args, **kwargs):
|
|
29
|
+
from werkzeug.exceptions import HTTPException
|
|
29
30
|
callback = fn(*args, **kwargs)
|
|
30
|
-
if
|
|
31
|
+
if callback is None:
|
|
31
32
|
e = args[1]
|
|
32
33
|
errors = [e.__class__.__name__]
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
status_code = getattr(e, 'code', 500)
|
|
35
|
+
#Flask 레이어의 예외 처리
|
|
36
|
+
if isinstance(e, HTTPException):
|
|
35
37
|
errors.append(e.description)
|
|
38
|
+
|
|
39
|
+
#Flask 예외 객체가 아닌 경우의 예외처리
|
|
40
|
+
#에러 코드와 메세지가 함께 나타날 수 있음.
|
|
36
41
|
else:
|
|
37
42
|
status_code = 500
|
|
38
|
-
errors.append(e
|
|
39
|
-
|
|
43
|
+
errors.append(str(e))
|
|
40
44
|
interceptor_error(status_code, errors)
|
|
41
|
-
|
|
45
|
+
|
|
42
46
|
return callback
|
|
43
|
-
|
|
47
|
+
|
|
44
48
|
return trace
|
|
45
49
|
if hasattr(module.Flask, '_find_error_handler'):
|
|
46
50
|
module.Flask._find_error_handler = wrapper(
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import traceback
|
|
2
|
+
from whatap.trace.mod.application_wsgi import interceptor, trace_handler, interceptor_error
|
|
3
|
+
from whatap.trace.trace_context_manager import TraceContextManager
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def instrument(module):
|
|
7
|
+
root = module.http.root
|
|
8
|
+
AppClass = root.__class__
|
|
9
|
+
original_call = AppClass.__call__
|
|
10
|
+
|
|
11
|
+
def wrapper(fn):
|
|
12
|
+
@trace_handler(fn, True)
|
|
13
|
+
def trace(self, environ, start_response):
|
|
14
|
+
def custom_start_response(status, headers, exc_info=None):
|
|
15
|
+
ctx = TraceContextManager.getLocalContext()
|
|
16
|
+
try:
|
|
17
|
+
ctx.status = int(status.split()[0])
|
|
18
|
+
except:
|
|
19
|
+
ctx.status = 0
|
|
20
|
+
return start_response(status, headers, exc_info)
|
|
21
|
+
try:
|
|
22
|
+
callback = interceptor(fn, self, environ, custom_start_response)
|
|
23
|
+
except Exception as e:
|
|
24
|
+
interceptor_error(
|
|
25
|
+
500 , #해당 status 값은 에러 처리용으로만 사용됩니다.
|
|
26
|
+
[e.__class__.__name__, str(e)]
|
|
27
|
+
)
|
|
28
|
+
raise
|
|
29
|
+
return callback
|
|
30
|
+
|
|
31
|
+
return trace
|
|
32
|
+
|
|
33
|
+
AppClass.__call__ = wrapper(original_call)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
Odoo 16+ HttpDispatcher.handle_error 패치
|
|
38
|
+
"""
|
|
39
|
+
Dispatcher = getattr(module.http, 'HttpDispatcher', None)
|
|
40
|
+
|
|
41
|
+
if Dispatcher:
|
|
42
|
+
original_handle_error = Dispatcher.handle_error
|
|
43
|
+
|
|
44
|
+
def wrapper(fn):
|
|
45
|
+
@trace_handler(fn)
|
|
46
|
+
def trace(self,exception):
|
|
47
|
+
ctx = TraceContextManager.getLocalContext()
|
|
48
|
+
interceptor_error(
|
|
49
|
+
500, # 해당 status 값은 에러 처리용으로만 사용됩니다.
|
|
50
|
+
[exception.__class__.__name__,
|
|
51
|
+
str(exception)],
|
|
52
|
+
ctx=ctx
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
callback = fn(self, exception)
|
|
56
|
+
return callback
|
|
57
|
+
|
|
58
|
+
return trace
|
|
59
|
+
Dispatcher.handle_error = wrapper(Dispatcher.handle_error)
|
|
@@ -404,7 +404,7 @@ def interceptor_db_con(fn, db_info, *args, **kwargs):
|
|
|
404
404
|
x.split('=') for x in re.sub(r'\s*=\s*', '=', args[0]).split())
|
|
405
405
|
|
|
406
406
|
text = '{}://'.format(db_info.get('type'))
|
|
407
|
-
text += kwargs.get('user')
|
|
407
|
+
text += kwargs.get('user' , '')
|
|
408
408
|
text += "@"
|
|
409
409
|
text += kwargs.get('host', kwargs.get('dsn', ''))
|
|
410
410
|
text += '/'
|
|
@@ -421,7 +421,7 @@ def interceptor_db_con(fn, db_info, *args, **kwargs):
|
|
|
421
421
|
return callback
|
|
422
422
|
|
|
423
423
|
|
|
424
|
-
def
|
|
424
|
+
def addQuoteDict(arg_dict):
|
|
425
425
|
quoted_dict = dict()
|
|
426
426
|
|
|
427
427
|
for k, v in arg_dict.items():
|
|
@@ -452,7 +452,7 @@ def interceptor_db_execute(fn, db_info, *args, **kwargs):
|
|
|
452
452
|
query = None
|
|
453
453
|
if len(args) > 2 and type(args[2]) == dict and args[2]:
|
|
454
454
|
try:
|
|
455
|
-
query = args[1] %
|
|
455
|
+
query = args[1] % addQuoteDict(args[2])
|
|
456
456
|
except Exception as e:
|
|
457
457
|
pass
|
|
458
458
|
if len(args) > 2 and type(args[2]) in (list, tuple) and args[2]:
|
|
@@ -473,7 +473,7 @@ def interceptor_db_execute(fn, db_info, *args, **kwargs):
|
|
|
473
473
|
ctx.start_time = start_time
|
|
474
474
|
|
|
475
475
|
text = '{}://'.format(db_info.get('type'))
|
|
476
|
-
text += db_info.get('user')
|
|
476
|
+
text += db_info.get('user' , '')
|
|
477
477
|
text += "@"
|
|
478
478
|
text += db_info.get('host', db_info.get('dsn', ''))
|
|
479
479
|
text += '/'
|
|
@@ -500,7 +500,8 @@ def interceptor_db_execute(fn, db_info, *args, **kwargs):
|
|
|
500
500
|
ctx.elapsed = DateUtil.nowSystem() - start_time
|
|
501
501
|
async_sender.send_packet(PacketTypeEnum.TX_SQL, ctx, datas)
|
|
502
502
|
count = self.rowcount
|
|
503
|
-
|
|
503
|
+
|
|
504
|
+
if (count is not None) and (count > -1):
|
|
504
505
|
desc = '{0}: {1}'.format('Fetch count', count)
|
|
505
506
|
datas = [' ', ' ', desc]
|
|
506
507
|
ctx.elapsed = 0
|
|
@@ -78,7 +78,14 @@ def instrument_sqlalchemy_engine(module):
|
|
|
78
78
|
except Exception as e:
|
|
79
79
|
query = str(args[2])
|
|
80
80
|
# print('instrument_sqlalchemy_engine 3:', query)
|
|
81
|
-
|
|
81
|
+
sqlalchemy_track_skip = False
|
|
82
|
+
except_track_module = ['pymysql', 'mysqldb', 'psycopg2']
|
|
83
|
+
|
|
84
|
+
# 이미 DB드라이브 추적 모듈이 존재하면 sqlAlhechmy 의 추적 중지
|
|
85
|
+
if any(keyword in str(args[0]) for keyword in except_track_module):
|
|
86
|
+
sqlalchemy_track_skip = True
|
|
87
|
+
|
|
88
|
+
if (not query) or (sqlalchemy_track_skip):
|
|
82
89
|
return fn(*args, **kwargs)
|
|
83
90
|
|
|
84
91
|
start_time = DateUtil.nowSystem()
|
|
@@ -59,6 +59,7 @@ whatap/trace/mod/application_flask.py
|
|
|
59
59
|
whatap/trace/mod/application_frappe.py
|
|
60
60
|
whatap/trace/mod/application_graphql.py
|
|
61
61
|
whatap/trace/mod/application_nameko.py
|
|
62
|
+
whatap/trace/mod/application_odoo.py
|
|
62
63
|
whatap/trace/mod/application_starlette.py
|
|
63
64
|
whatap/trace/mod/application_tornado.py
|
|
64
65
|
whatap/trace/mod/application_wsgi.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|