whatap-python 1.8.7__tar.gz → 1.8.9__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.7 → whatap_python-1.8.9}/PKG-INFO +1 -1
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/__init__.py +4 -4
- whatap_python-1.8.9/whatap/build.py +4 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/conf/configuration.py +3 -0
- whatap_python-1.8.7/whatap/trace/mod/amqp_kombu.py → whatap_python-1.8.9/whatap/trace/mod/amqp/kombu.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/amqp_pika.py → whatap_python-1.8.9/whatap/trace/mod/amqp/pika.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_bottle.py → whatap_python-1.8.9/whatap/trace/mod/application/bottle.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_celery.py → whatap_python-1.8.9/whatap/trace/mod/application/celery.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_cherrypy.py → whatap_python-1.8.9/whatap/trace/mod/application/cherrypy.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_django.py → whatap_python-1.8.9/whatap/trace/mod/application/django.py +3 -3
- whatap_python-1.8.7/whatap/trace/mod/application_django_asgi.py → whatap_python-1.8.9/whatap/trace/mod/application/django_asgi.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_django_py3.py → whatap_python-1.8.9/whatap/trace/mod/application/django_py3.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_fastapi.py → whatap_python-1.8.9/whatap/trace/mod/application/fastapi.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_flask.py → whatap_python-1.8.9/whatap/trace/mod/application/flask.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_frappe.py → whatap_python-1.8.9/whatap/trace/mod/application/frappe.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_graphql.py → whatap_python-1.8.9/whatap/trace/mod/application/graphql.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_nameko.py → whatap_python-1.8.9/whatap/trace/mod/application/nameko.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_odoo.py → whatap_python-1.8.9/whatap/trace/mod/application/odoo.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_starlette.py → whatap_python-1.8.9/whatap/trace/mod/application/starlette.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_tornado.py → whatap_python-1.8.9/whatap/trace/mod/application/tornado.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/application_wsgi.py → whatap_python-1.8.9/whatap/trace/mod/application/wsgi.py +66 -27
- whatap_python-1.8.9/whatap/trace/mod/database/__init__.py +0 -0
- whatap_python-1.8.7/whatap/trace/mod/database_cxoracle.py → whatap_python-1.8.9/whatap/trace/mod/database/cxoracle.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/database_mongo.py → whatap_python-1.8.9/whatap/trace/mod/database/mongo.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/database_mysql.py → whatap_python-1.8.9/whatap/trace/mod/database/mysql.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/database_neo4j.py → whatap_python-1.8.9/whatap/trace/mod/database/neo4j.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/database_postgresql.py → whatap_python-1.8.9/whatap/trace/mod/database/postgresql.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/database_redis.py → whatap_python-1.8.9/whatap/trace/mod/database/redis.py +1 -1
- whatap_python-1.8.9/whatap/trace/mod/database/sqlite3.py +124 -0
- whatap_python-1.8.7/whatap/trace/mod/database_toolkit.py → whatap_python-1.8.9/whatap/trace/mod/database/toolkit.py +1 -1
- whatap_python-1.8.9/whatap/trace/mod/email/__init__.py +0 -0
- whatap_python-1.8.7/whatap/trace/mod/email_smtp.py → whatap_python-1.8.9/whatap/trace/mod/email/smtp.py +1 -1
- whatap_python-1.8.9/whatap/trace/mod/httpc/__init__.py +0 -0
- whatap_python-1.8.7/whatap/trace/mod/httpc_django.py → whatap_python-1.8.9/whatap/trace/mod/httpc/django.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/httpc_httplib.py → whatap_python-1.8.9/whatap/trace/mod/httpc/httplib.py +1 -1
- whatap_python-1.8.9/whatap/trace/mod/httpc/httpx.py +24 -0
- whatap_python-1.8.7/whatap/trace/mod/httpc_requests.py → whatap_python-1.8.9/whatap/trace/mod/httpc/requests.py +1 -1
- whatap_python-1.8.7/whatap/trace/mod/httpc_urllib3.py → whatap_python-1.8.9/whatap/trace/mod/httpc/urllib3.py +1 -1
- whatap_python-1.8.9/whatap/trace/mod/llm/__init__.py +0 -0
- whatap_python-1.8.9/whatap/trace/mod/llm/openai.py +199 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/mod/plugin.py +1 -1
- whatap_python-1.8.9/whatap/trace/mod/standalone/__init__.py +0 -0
- whatap_python-1.8.7/whatap/trace/mod/standalone_multiple.py → whatap_python-1.8.9/whatap/trace/mod/standalone/multiple.py +1 -1
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/trace_module_definition.py +56 -41
- whatap_python-1.8.9/whatap/util/__init__.py +0 -0
- whatap_python-1.8.9/whatap/util/cardinality/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap_python.egg-info/PKG-INFO +1 -1
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap_python.egg-info/SOURCES.txt +41 -31
- whatap_python-1.8.7/whatap/build.py +0 -4
- {whatap_python-1.8.7 → whatap_python-1.8.9}/README.md +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/setup.cfg +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/setup.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/LICENSE +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/README.rst +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/__main__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/agent/darwin/amd64/whatap_python +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/agent/darwin/arm64/whatap_python +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/agent/linux/amd64/whatap_python +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/agent/linux/arm64/whatap_python +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/bootstrap/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/bootstrap/sitecustomize.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/conf/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/conf/configure.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/conf/license.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/control/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/counter/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/counter/counter_manager.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/counter/tasks/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/counter/tasks/openfiledescriptor.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/io/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/io/data_inputx.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/io/data_outputx.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/net/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/net/async_sender.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/net/packet_enum.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/net/packet_type_enum.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/net/param_def.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/net/stackhelper.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/net/udp_session.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/net/udp_thread.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/pack/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/pack/logSinkPack.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/pack/pack.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/pack/pack_enum.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/pack/tagCountPack.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/scripts/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/mod/__init__.py +0 -0
- {whatap_python-1.8.7/whatap/util → whatap_python-1.8.9/whatap/trace/mod/amqp}/__init__.py +0 -0
- {whatap_python-1.8.7/whatap/util/cardinality → whatap_python-1.8.9/whatap/trace/mod/application}/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/mod/logging.py +0 -0
- /whatap_python-1.8.7/whatap/trace/mod/standalone_single.py → /whatap_python-1.8.9/whatap/trace/mod/standalone/single.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/simple_trace_context.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/trace_context.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/trace_context_manager.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/trace/trace_import.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/bit_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/cardinality/hyperloglog.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/cardinality/murmurhash.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/cardinality/registerset.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/compare_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/date_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/debug_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/escape_literal_sql.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/hash_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/hexa32.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/int_set.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/ip_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/keygen.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/linked_list.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/linked_map.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/metering_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/request_double_queue.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/request_queue.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/string_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/throttle_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/util/userid_util.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/__init__.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/blob_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/boolean_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/decimal_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/double_summary.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/double_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/float_array.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/float_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/int_array.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/ip4_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/list_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/long_array.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/long_summary.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/map_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/null_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/number_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/summary_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/text_array.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/text_hash_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/text_value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/value.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/value/value_enum.py +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap/whatap.conf +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap_python.egg-info/dependency_links.txt +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap_python.egg-info/entry_points.txt +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap_python.egg-info/not-zip-safe +0 -0
- {whatap_python-1.8.7 → whatap_python-1.8.9}/whatap_python.egg-info/top_level.txt +0 -0
|
@@ -340,10 +340,10 @@ def hooks(home):
|
|
|
340
340
|
|
|
341
341
|
if conf.standalone_enabled:
|
|
342
342
|
if conf.standalone_type == 'multiple-transaction':
|
|
343
|
-
from whatap.trace.mod.
|
|
343
|
+
from whatap.trace.mod.standalone.multiple import instrument_standalone_multiple
|
|
344
344
|
instrument_standalone_multiple()
|
|
345
345
|
else:
|
|
346
|
-
from whatap.trace.mod.
|
|
346
|
+
from whatap.trace.mod.standalone.single import instrument_standalone_single
|
|
347
347
|
instrument_standalone_single()
|
|
348
348
|
|
|
349
349
|
except Exception as e:
|
|
@@ -453,9 +453,9 @@ def go(batch=False, opts={}):
|
|
|
453
453
|
|
|
454
454
|
import signal
|
|
455
455
|
|
|
456
|
-
from whatap.trace.mod.
|
|
456
|
+
from whatap.trace.mod.application.wsgi import interceptor, start_interceptor, \
|
|
457
457
|
end_interceptor, trace_handler, interceptor_step_error
|
|
458
|
-
from whatap.trace.mod.
|
|
458
|
+
from whatap.trace.mod.application.fastapi import interceptor_error_log
|
|
459
459
|
from whatap.trace.trace_context import TraceContext, TraceContextManager
|
|
460
460
|
|
|
461
461
|
def register_app(fn):
|
|
@@ -4,6 +4,7 @@ Configuration = {
|
|
|
4
4
|
"ignore_whatap_stdout" : False,
|
|
5
5
|
"net_udp_port": "6600",
|
|
6
6
|
"web_static_content_extensions": "js, htm, html, gif, png, jpg, css, swf, ico",
|
|
7
|
+
|
|
7
8
|
"trace_auto_normalize_enabled": True,
|
|
8
9
|
"trace_user_enabled": True,
|
|
9
10
|
"trace_user_using_ip": True,
|
|
@@ -15,6 +16,8 @@ Configuration = {
|
|
|
15
16
|
"trace_ignore_url_prefix": None,
|
|
16
17
|
"trace_websocket_enabled": False,
|
|
17
18
|
|
|
19
|
+
"trace_llm_log_enabled": False,
|
|
20
|
+
|
|
18
21
|
"debug": False,
|
|
19
22
|
"query_string_enabled": False,
|
|
20
23
|
"query_string_urls": "",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from whatap.trace import get_dict
|
|
2
|
-
from whatap.trace.mod.
|
|
2
|
+
from whatap.trace.mod.application.wsgi import trace_handler, \
|
|
3
3
|
interceptor_step_error, start_interceptor, end_interceptor
|
|
4
4
|
from whatap.trace.trace_context import TraceContext
|
|
5
5
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from whatap.trace import get_dict
|
|
2
|
-
from whatap.trace.mod.
|
|
2
|
+
from whatap.trace.mod.application.wsgi import trace_handler, \
|
|
3
3
|
interceptor_step_error, start_interceptor, end_interceptor
|
|
4
4
|
from whatap.trace.trace_context import TraceContext
|
|
5
5
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from functools import wraps
|
|
2
2
|
from whatap.trace.trace_context import TraceContext
|
|
3
3
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
4
|
-
from whatap.trace.mod.
|
|
4
|
+
from whatap.trace.mod.application.wsgi import start_interceptor, end_interceptor, interceptor_step_error
|
|
5
5
|
from whatap import logging
|
|
6
6
|
from whatap.conf.configure import Configure as conf
|
|
7
7
|
import time
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from whatap.conf.configure import Configure as conf
|
|
2
2
|
from whatap.net.packet_type_enum import PacketTypeEnum
|
|
3
3
|
import whatap.net.async_sender as async_sender
|
|
4
|
-
from whatap.trace.mod.
|
|
4
|
+
from whatap.trace.mod.application.wsgi import interceptor, trace_handler, \
|
|
5
5
|
interceptor_error, interceptor_step_error
|
|
6
6
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
7
7
|
from whatap.trace.trace_context import TraceContext
|
|
@@ -76,7 +76,7 @@ def instrument_asgi(module):
|
|
|
76
76
|
module.ASGIHandler.__call__ = wrapper(module.ASGIHandler.__call__)
|
|
77
77
|
|
|
78
78
|
try:
|
|
79
|
-
from whatap.trace.mod.
|
|
79
|
+
from whatap.trace.mod.application.django_py3 import \
|
|
80
80
|
instrument_handlers_async, interceptor_async,\
|
|
81
81
|
trace_handler_async, blocking_handler_async,\
|
|
82
82
|
parseHeaders as parseHeadersAsync,\
|
|
@@ -84,7 +84,7 @@ try:
|
|
|
84
84
|
|
|
85
85
|
django_py3_loaded = True
|
|
86
86
|
except Exception as e:
|
|
87
|
-
print("
|
|
87
|
+
print("application.django error:",e)
|
|
88
88
|
django_py3_loaded = False
|
|
89
89
|
|
|
90
90
|
def instrument_handlers_channels(module):
|
|
@@ -4,7 +4,7 @@ from whatap.conf.configure import Configure as conf
|
|
|
4
4
|
from whatap.net import async_sender
|
|
5
5
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
6
6
|
from whatap.trace.trace_context import TraceContext
|
|
7
|
-
from whatap.trace.mod.
|
|
7
|
+
from whatap.trace.mod.application.wsgi import isIgnore, start_interceptor, end_interceptor
|
|
8
8
|
from whatap.util.hash_util import HashUtil as hash_util
|
|
9
9
|
from whatap.util.userid_util import UseridUtil
|
|
10
10
|
from whatap.util.date_util import DateUtil
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
from whatap.conf.configure import Configure as conf
|
|
3
3
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
4
4
|
from whatap.trace.trace_context import TraceContext
|
|
5
|
-
from whatap.trace.mod.
|
|
5
|
+
from whatap.trace.mod.application.wsgi import \
|
|
6
6
|
interceptor_error,isIgnore, start_interceptor, end_interceptor
|
|
7
7
|
from whatap.util.hash_util import HashUtil as hash_util
|
|
8
8
|
from whatap.util.userid_util import UseridUtil
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from whatap.trace import get_dict
|
|
2
|
-
from whatap.trace.mod.
|
|
2
|
+
from whatap.trace.mod.application.wsgi import trace_handler, \
|
|
3
3
|
interceptor_step_error, start_interceptor, end_interceptor
|
|
4
4
|
from whatap.trace.trace_context import TraceContext
|
|
5
5
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from whatap.trace import get_dict
|
|
2
|
-
from whatap.trace.mod.
|
|
2
|
+
from whatap.trace.mod.application.wsgi import trace_handler, \
|
|
3
3
|
interceptor_step_error, start_interceptor, end_interceptor
|
|
4
4
|
from whatap.trace.trace_context import TraceContext
|
|
5
5
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import traceback
|
|
2
|
-
from whatap.trace.mod.
|
|
2
|
+
from whatap.trace.mod.application.wsgi import interceptor, trace_handler, interceptor_error
|
|
3
3
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
4
4
|
|
|
5
5
|
|
|
@@ -4,7 +4,7 @@ from whatap.trace.trace_context_manager import TraceContextManager
|
|
|
4
4
|
from whatap.net.packet_type_enum import PacketTypeEnum
|
|
5
5
|
from whatap.util.date_util import DateUtil
|
|
6
6
|
from whatap.util.userid_util import UseridUtil as userid_util
|
|
7
|
-
from whatap.trace.mod.
|
|
7
|
+
from whatap.trace.mod.application.wsgi import interceptor_step_error, \
|
|
8
8
|
start_interceptor,end_interceptor
|
|
9
9
|
from whatap.conf.configure import Configure as conf
|
|
10
10
|
from typing import Any
|
|
@@ -6,7 +6,7 @@ from whatap.trace.trace_context import TraceContext
|
|
|
6
6
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
7
7
|
from whatap.util.date_util import DateUtil
|
|
8
8
|
from whatap.conf.configure import Configure as conf
|
|
9
|
-
from whatap.trace.mod.
|
|
9
|
+
from whatap.trace.mod.application.wsgi import trace_handler, \
|
|
10
10
|
start_interceptor, end_interceptor, interceptor_error, isIgnore
|
|
11
11
|
|
|
12
12
|
|
|
@@ -403,11 +403,17 @@ def interceptor_db_con(fn, db_info, *args, **kwargs):
|
|
|
403
403
|
kwargs = dict(
|
|
404
404
|
x.split('=') for x in re.sub(r'\s*=\s*', '=', args[0]).split())
|
|
405
405
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
406
|
+
db_type = db_info.get('type')
|
|
407
|
+
|
|
408
|
+
if db_type == "sqlite":
|
|
409
|
+
text = "sqlite:"
|
|
410
|
+
else:
|
|
411
|
+
text = '{}://'.format(db_type)
|
|
412
|
+
text += kwargs.get('user', '')
|
|
413
|
+
text += "@"
|
|
414
|
+
text += kwargs.get('host', kwargs.get('dsn', ''))
|
|
415
|
+
text += '/'
|
|
416
|
+
|
|
411
417
|
text += kwargs.get('database', kwargs.get('db', kwargs.get('dbname', '')))
|
|
412
418
|
ctx.active_dbc = text
|
|
413
419
|
ctx.lctx['dbc'] = text
|
|
@@ -445,14 +451,58 @@ def addQuoteList(arg_list):
|
|
|
445
451
|
return tuple(quoted_list)
|
|
446
452
|
|
|
447
453
|
def neo4jQuery(query,paremeter):
|
|
448
|
-
|
|
454
|
+
neo4j_query = query
|
|
449
455
|
|
|
450
456
|
for key, value in paremeter.items():
|
|
451
457
|
placeholder = f"${key}"
|
|
452
458
|
replacement = f"'{str(value)}'"
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return
|
|
459
|
+
neo4j_query = neo4j_query.replace(placeholder, replacement)
|
|
460
|
+
|
|
461
|
+
return neo4j_query
|
|
462
|
+
|
|
463
|
+
def sqliteQuery(query, paremeter):
|
|
464
|
+
sqlite_query = query
|
|
465
|
+
|
|
466
|
+
def quote(v):
|
|
467
|
+
if v is None: return "NULL"
|
|
468
|
+
if isinstance(v, (bytes, bytearray)): return "X'" + v.hex() + "'"
|
|
469
|
+
return "'" + str(v).replace("'", "''") + "'"
|
|
470
|
+
|
|
471
|
+
# 이름 기반: :name / @name / $name (단일 세트)
|
|
472
|
+
if isinstance(paremeter, dict):
|
|
473
|
+
for pfx in (':', '@', '$'):
|
|
474
|
+
for k, v in paremeter.items():
|
|
475
|
+
sqlite_query = sqlite_query.replace(f"{pfx}{k}", quote(v))
|
|
476
|
+
return sqlite_query
|
|
477
|
+
|
|
478
|
+
# 포지셔널 + executemany 분기
|
|
479
|
+
if isinstance(paremeter, (list, tuple)):
|
|
480
|
+
# ── executemany: [tuple|dict, ...] ──
|
|
481
|
+
if isinstance(paremeter, list) and paremeter and isinstance(paremeter[0], (tuple, dict)):
|
|
482
|
+
stmts = []
|
|
483
|
+
for params in paremeter:
|
|
484
|
+
sqlite_query = query
|
|
485
|
+
if isinstance(params, dict):
|
|
486
|
+
for pfx in (':', '@', '$'):
|
|
487
|
+
for k, v in params.items():
|
|
488
|
+
sqlite_query = sqlite_query.replace(f"{pfx}{k}", quote(v))
|
|
489
|
+
else: # tuple
|
|
490
|
+
for i, v in enumerate(params, 1):
|
|
491
|
+
sqlite_query = sqlite_query.replace(f"?{i}", quote(v))
|
|
492
|
+
for v in params:
|
|
493
|
+
sqlite_query = sqlite_query.replace('?', quote(v), 1)
|
|
494
|
+
stmts.append(sqlite_query)
|
|
495
|
+
return ";\n".join(stmts)
|
|
496
|
+
|
|
497
|
+
# ── 단일 포지셔널 세트 (tuple 또는 스칼라 list) ──
|
|
498
|
+
seq = paremeter if isinstance(paremeter, tuple) else tuple(paremeter)
|
|
499
|
+
for i, v in enumerate(seq, 1):
|
|
500
|
+
sqlite_query = sqlite_query.replace(f"?{i}", quote(v))
|
|
501
|
+
for v in seq:
|
|
502
|
+
sqlite_query = sqlite_query.replace('?', quote(v), 1)
|
|
503
|
+
return sqlite_query
|
|
504
|
+
|
|
505
|
+
return sqlite_query
|
|
456
506
|
|
|
457
507
|
def interceptor_db_execute(fn, db_info, *args, **kwargs):
|
|
458
508
|
ctx = TraceContextManager.getLocalContext()
|
|
@@ -466,6 +516,13 @@ def interceptor_db_execute(fn, db_info, *args, **kwargs):
|
|
|
466
516
|
query = neo4jQuery(args[1], kwargs)
|
|
467
517
|
except Exception as e:
|
|
468
518
|
pass
|
|
519
|
+
|
|
520
|
+
elif db_type == "sqlite" and len(args) > 2:
|
|
521
|
+
try:
|
|
522
|
+
query = sqliteQuery(args[1],args[2])
|
|
523
|
+
except Exception as e:
|
|
524
|
+
pass
|
|
525
|
+
|
|
469
526
|
else:
|
|
470
527
|
if len(args) > 2 and type(args[2]) == dict and args[2]:
|
|
471
528
|
try:
|
|
@@ -486,24 +543,6 @@ def interceptor_db_execute(fn, db_info, *args, **kwargs):
|
|
|
486
543
|
if not query:
|
|
487
544
|
return fn(*args, **kwargs)
|
|
488
545
|
|
|
489
|
-
start_time = DateUtil.nowSystem()
|
|
490
|
-
ctx.start_time = start_time
|
|
491
|
-
|
|
492
|
-
text = '{}://'.format(db_info.get('type'))
|
|
493
|
-
text += db_info.get('user' , '')
|
|
494
|
-
text += "@"
|
|
495
|
-
text += db_info.get('host', db_info.get('dsn', ''))
|
|
496
|
-
text += '/'
|
|
497
|
-
text += db_info.get('database', db_info.get('db', db_info.get('dbname', '')))
|
|
498
|
-
ctx.active_dbc = text
|
|
499
|
-
ctx.lctx['dbc'] = text
|
|
500
|
-
|
|
501
|
-
ctx.active_dbc = 0
|
|
502
|
-
|
|
503
|
-
datas = [text]
|
|
504
|
-
ctx.elapsed = DateUtil.nowSystem() - start_time
|
|
505
|
-
async_sender.send_packet(PacketTypeEnum.TX_DB_CONN, ctx, datas)
|
|
506
|
-
|
|
507
546
|
start_time = DateUtil.nowSystem()
|
|
508
547
|
ctx.start_time = start_time
|
|
509
548
|
ctx.active_sqlhash = query
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import pymongo.monitoring
|
|
2
2
|
from whatap.trace import get_dict
|
|
3
|
-
from whatap.trace.mod.
|
|
3
|
+
from whatap.trace.mod.application.wsgi import trace_handler, \
|
|
4
4
|
interceptor_step_error
|
|
5
5
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
6
6
|
import whatap.net.async_sender as async_sender
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from whatap.trace import get_dict
|
|
2
|
-
from whatap.trace.mod.
|
|
2
|
+
from whatap.trace.mod.application.wsgi import trace_handler, interceptor_step_error
|
|
3
3
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
4
4
|
import whatap.net.async_sender as async_sender
|
|
5
5
|
from whatap.net.packet_type_enum import PacketTypeEnum
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
from whatap.trace.mod.application.wsgi import trace_handler, \
|
|
2
|
+
interceptor_db_con, interceptor_db_execute, interceptor_db_close
|
|
3
|
+
|
|
4
|
+
class CursorProxy:
|
|
5
|
+
def __init__(self, real_cursor, db_info):
|
|
6
|
+
self._cur = real_cursor
|
|
7
|
+
self._db_info = db_info
|
|
8
|
+
|
|
9
|
+
def execute_wrapper(self, original_execute_method):
|
|
10
|
+
owner = getattr(original_execute_method, "__self__", None)
|
|
11
|
+
|
|
12
|
+
def safe_execute(*args, **kwargs):
|
|
13
|
+
if args and owner is not None and args[0] is owner:
|
|
14
|
+
args = args[1:]
|
|
15
|
+
return original_execute_method(*args, **kwargs)
|
|
16
|
+
|
|
17
|
+
return safe_execute
|
|
18
|
+
|
|
19
|
+
def execute(self, *args, **kwargs):
|
|
20
|
+
safe_fn = self.execute_wrapper(self._cur.execute)
|
|
21
|
+
callback = interceptor_db_execute(safe_fn, self._db_info, self._cur, *args, **kwargs)
|
|
22
|
+
return callback
|
|
23
|
+
|
|
24
|
+
def executemany(self, *args, **kwargs):
|
|
25
|
+
safe_fn = self.execute_wrapper(self._cur.executemany)
|
|
26
|
+
callback = interceptor_db_execute(safe_fn, self._db_info, self._cur, *args, **kwargs)
|
|
27
|
+
return callback
|
|
28
|
+
|
|
29
|
+
def executescript(self, *args, **kwargs):
|
|
30
|
+
safe_fn = self.execute_wrapper(self._cur.executescript)
|
|
31
|
+
callback = interceptor_db_execute(safe_fn, self._db_info, self._cur, *args, **kwargs)
|
|
32
|
+
return callback
|
|
33
|
+
|
|
34
|
+
def close(self, *args, **kwargs):
|
|
35
|
+
callback = self._cur.close(*args, **kwargs)
|
|
36
|
+
return callback
|
|
37
|
+
|
|
38
|
+
def __enter__(self):
|
|
39
|
+
self._cur.__enter__()
|
|
40
|
+
return self
|
|
41
|
+
|
|
42
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
43
|
+
return self._cur.__exit__(exc_type, exc_val, exc_tb)
|
|
44
|
+
|
|
45
|
+
def __getattr__(self, name):
|
|
46
|
+
return getattr(self._cur, name)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class ConnectionProxy:
|
|
50
|
+
def __init__(self, real_connection, db_info):
|
|
51
|
+
self._real_connection = real_connection
|
|
52
|
+
self._db_info = db_info
|
|
53
|
+
|
|
54
|
+
def execute_wrapper(self, original_execute_method):
|
|
55
|
+
owner = getattr(original_execute_method, "__self__", None)
|
|
56
|
+
|
|
57
|
+
def safe_execute(*args, **kwargs):
|
|
58
|
+
if args and owner is not None and args[0] is owner:
|
|
59
|
+
args = args[1:]
|
|
60
|
+
return original_execute_method(*args, **kwargs)
|
|
61
|
+
|
|
62
|
+
return safe_execute
|
|
63
|
+
|
|
64
|
+
def execute(self, *args, **kwargs):
|
|
65
|
+
real_cursor = self._real_connection.cursor()
|
|
66
|
+
safe_fn = self.execute_wrapper(real_cursor.execute)
|
|
67
|
+
callback = interceptor_db_execute(safe_fn,self._db_info,real_cursor,*args,**kwargs)
|
|
68
|
+
return callback
|
|
69
|
+
|
|
70
|
+
def executemany(self, *args, **kwargs):
|
|
71
|
+
real_cursor = self._real_connection.cursor()
|
|
72
|
+
safe_fn = self.execute_wrapper(real_cursor.executemany)
|
|
73
|
+
callback = interceptor_db_execute(safe_fn, self._db_info, real_cursor, *args, **kwargs)
|
|
74
|
+
return callback
|
|
75
|
+
|
|
76
|
+
def executescript(self, *args, **kwargs):
|
|
77
|
+
real_cursor = self._real_connection.cursor()
|
|
78
|
+
safe_fn = self.execute_wrapper(real_cursor.executescript)
|
|
79
|
+
callback = interceptor_db_execute(safe_fn, self._db_info, real_cursor, *args, **kwargs)
|
|
80
|
+
return callback
|
|
81
|
+
|
|
82
|
+
def cursor(self, *args, **kwargs):
|
|
83
|
+
real_cursor = self._real_connection.cursor(*args, **kwargs)
|
|
84
|
+
return CursorProxy(real_cursor, self._db_info)
|
|
85
|
+
|
|
86
|
+
def close(self, *args, **kwargs):
|
|
87
|
+
callback = interceptor_db_close(self._real_connection.close, *args, **kwargs)
|
|
88
|
+
return callback
|
|
89
|
+
|
|
90
|
+
def __getattr__(self, name):
|
|
91
|
+
return getattr(self._real_connection, name)
|
|
92
|
+
|
|
93
|
+
def __enter__(self):
|
|
94
|
+
self._real_connection.__enter__()
|
|
95
|
+
return self
|
|
96
|
+
|
|
97
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
98
|
+
return self._real_connection.__exit__(exc_type, exc_val, exc_tb)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def instrument_sqlite3(module):
|
|
102
|
+
|
|
103
|
+
def wrapper(fn):
|
|
104
|
+
@trace_handler(fn)
|
|
105
|
+
def trace(*args, **kwargs):
|
|
106
|
+
if args:
|
|
107
|
+
kwargs['database'] = args[0]
|
|
108
|
+
args = args[1:]
|
|
109
|
+
|
|
110
|
+
db_name = kwargs.get('database', 'unknown')
|
|
111
|
+
db_info = {'type': 'sqlite', 'db': db_name}
|
|
112
|
+
db_info.update(kwargs)
|
|
113
|
+
|
|
114
|
+
real_connection = interceptor_db_con(fn, db_info, *args, **kwargs)
|
|
115
|
+
|
|
116
|
+
if real_connection:
|
|
117
|
+
return ConnectionProxy(real_connection, db_info)
|
|
118
|
+
|
|
119
|
+
return real_connection
|
|
120
|
+
|
|
121
|
+
return trace
|
|
122
|
+
|
|
123
|
+
if hasattr(module, "connect"):
|
|
124
|
+
module.connect = wrapper(module.connect)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from whatap.net.packet_type_enum import PacketTypeEnum
|
|
2
2
|
import whatap.net.async_sender as async_sender
|
|
3
|
-
from whatap.trace.mod.
|
|
3
|
+
from whatap.trace.mod.application.wsgi import trace_handler, interceptor_db_execute, interceptor_step_error, sendDebugProfile
|
|
4
4
|
from whatap.util.date_util import DateUtil
|
|
5
5
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
6
6
|
import sys
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from whatap.trace import get_dict
|
|
2
|
-
from whatap.trace.mod.
|
|
2
|
+
from whatap.trace.mod.application.wsgi import trace_handler, \
|
|
3
3
|
interceptor_step_error
|
|
4
4
|
from whatap.trace.trace_context_manager import TraceContextManager
|
|
5
5
|
import whatap.net.async_sender as async_sender
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from whatap.trace.mod.application.wsgi import transfer, trace_handler, \
|
|
2
|
+
interceptor_httpc_request
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def instrument_httpx(module):
|
|
6
|
+
def wrapper(fn):
|
|
7
|
+
@trace_handler(fn)
|
|
8
|
+
def trace(*args, **kwargs):
|
|
9
|
+
request = args[1]
|
|
10
|
+
request.headers = transfer(request.headers)
|
|
11
|
+
|
|
12
|
+
httpc_url = str(request.url)
|
|
13
|
+
callback = interceptor_httpc_request(fn, httpc_url, *args, **kwargs)
|
|
14
|
+
|
|
15
|
+
return callback
|
|
16
|
+
|
|
17
|
+
return trace
|
|
18
|
+
|
|
19
|
+
if hasattr(module, 'Client') and hasattr(module.Client, 'send'):
|
|
20
|
+
module.Client.send = wrapper(module.Client.send)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
if hasattr(module, 'AsyncClient') and hasattr(module.AsyncClient, 'send'):
|
|
24
|
+
module.AsyncClient.send = wrapper(module.AsyncClient.send)
|
|
File without changes
|