whatap-python 1.6.5__tar.gz → 1.6.7__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.6.5 → whatap_python-1.6.7}/PKG-INFO +1 -1
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/agent/linux/amd64/whatap_python +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/agent/linux/arm64/whatap_python +0 -0
- whatap_python-1.6.7/whatap/build.py +4 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/net/async_sender.py +6 -2
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_fastapi.py +1 -1
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_wsgi.py +1 -1
- whatap_python-1.6.7/whatap/trace/simple_trace_context.py +18 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap_python.egg-info/PKG-INFO +1 -1
- whatap_python-1.6.5/whatap/build.py +0 -4
- whatap_python-1.6.5/whatap/trace/simple_trace_context.py +0 -9
- {whatap_python-1.6.5 → whatap_python-1.6.7}/README.md +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/setup.cfg +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/setup.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/LICENSE +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/README.rst +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/__main__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/agent/darwin/amd64/whatap_python +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/agent/darwin/arm64/whatap_python +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/bootstrap/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/bootstrap/sitecustomize.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/conf/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/conf/configuration.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/conf/configure.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/conf/license.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/control/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/io/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/io/data_inputx.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/io/data_outputx.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/net/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/net/packet_enum.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/net/packet_type_enum.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/net/param_def.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/net/stackhelper.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/net/udp_session.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/net/udp_thread.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/pack/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/pack/logSinkPack.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/pack/pack.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/pack/pack_enum.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/scripts/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/amqp_kombu.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/amqp_pika.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_bottle.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_celery.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_cherrypy.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_django.py +1 -1
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_django_py3.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_flask.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_frappe.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_graphql.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_nameko.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/application_tornado.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/database_mongo.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/database_mysql.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/database_postgresql.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/database_redis.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/database_toolkit.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/email_smtp.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/httpc_django.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/httpc_httplib.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/httpc_requests.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/httpc_urllib3.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/logging.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/mod/plugin.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/trace_context.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/trace_context_manager.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/trace_import.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/trace/trace_module_definition.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/bit_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/cardinality/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/cardinality/hyperloglog.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/cardinality/murmurhash.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/cardinality/registerset.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/compare_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/date_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/debug_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/escape_literal_sql.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/hash_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/hexa32.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/int_set.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/ip_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/keygen.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/linked_list.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/linked_map.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/metering_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/request_double_queue.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/request_queue.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/string_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/throttle_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/util/userid_util.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/__init__.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/blob_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/boolean_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/decimal_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/double_summary.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/double_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/float_array.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/float_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/int_array.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/ip4_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/list_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/long_array.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/long_summary.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/map_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/null_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/number_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/summary_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/text_array.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/text_hash_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/text_value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/value.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/value/value_enum.py +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap/whatap.conf +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap_python.egg-info/SOURCES.txt +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap_python.egg-info/dependency_links.txt +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap_python.egg-info/entry_points.txt +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap_python.egg-info/not-zip-safe +0 -0
- {whatap_python-1.6.5 → whatap_python-1.6.7}/whatap_python.egg-info/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import copy
|
|
1
2
|
import queue, time, threading
|
|
2
3
|
from . import udp_session
|
|
3
4
|
from whatap.conf.configure import Configure as conf
|
|
@@ -11,12 +12,15 @@ class SendType(Enum):
|
|
|
11
12
|
RELAY = 2
|
|
12
13
|
|
|
13
14
|
def send_packet( packet_type, ctx, datas=[]):
|
|
14
|
-
ctx = SimpleTraceContext(ctx
|
|
15
|
+
ctx = SimpleTraceContext(ctx)
|
|
16
|
+
|
|
17
|
+
# deep coopy TraceContext object before adding it to the queue, preventing potential data overwriting issues caused by concurrent modifications
|
|
18
|
+
copied_ctx = ctx.getDeepCopiedContext()
|
|
15
19
|
_initThread()
|
|
16
20
|
global q
|
|
17
21
|
if q.full():
|
|
18
22
|
return
|
|
19
|
-
q.put((SendType.DATAS, (packet_type,
|
|
23
|
+
q.put((SendType.DATAS, (packet_type, copied_ctx, datas)))
|
|
20
24
|
|
|
21
25
|
def send_relaypack( packbytes):
|
|
22
26
|
_initThread()
|
|
@@ -61,8 +61,8 @@ def getRemoteAddr(headers, whatap_dict):
|
|
|
61
61
|
if header_val:
|
|
62
62
|
return header_val.split(',')[0].strip()
|
|
63
63
|
x_forwarded_for = headers.get("x-forwarded-for")
|
|
64
|
-
x_forwarded_for = x_forwarded_for.split(',')[0].strip() if ',' in x_forwarded_for else None
|
|
65
64
|
if x_forwarded_for:
|
|
65
|
+
x_forwarded_for = x_forwarded_for.split(',')[0].strip() if ',' in x_forwarded_for else None
|
|
66
66
|
return x_forwarded_for
|
|
67
67
|
if whatap_dict:
|
|
68
68
|
return whatap_dict.get(_REMOTE_ADDR)
|
|
@@ -210,7 +210,7 @@ def interceptor(rn_environ, *args, **kwargs):
|
|
|
210
210
|
|
|
211
211
|
if getattr(callback, 'status_code', None):
|
|
212
212
|
status_code = callback.status_code
|
|
213
|
-
errors = [callback.
|
|
213
|
+
errors = [callback.__class__.__name__, callback.reason_phrase]
|
|
214
214
|
interceptor_error(status_code, errors, ctx=ctx)
|
|
215
215
|
|
|
216
216
|
if conf.profile_http_header_enabled:
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import copy
|
|
2
|
+
|
|
3
|
+
from whatap.trace.trace_context import TraceContext
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SimpleTraceContext(TraceContext):
|
|
7
|
+
def __init__(self, ctx: TraceContext):
|
|
8
|
+
self.ctx = ctx
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Replaced Python's built-in deepcopy function with a manual deep copy method in SimpleTraceContext.
|
|
12
|
+
This change prevents potential pickle errors when serializing the TraceContext object.
|
|
13
|
+
Each attribute is copied individually to ensure that complex objects within TraceContext are correctly handled.
|
|
14
|
+
"""
|
|
15
|
+
def getDeepCopiedContext(self):
|
|
16
|
+
for key, value in self.ctx.__dict__.items():
|
|
17
|
+
setattr(self, key, value)
|
|
18
|
+
return self
|
|
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
|
|
@@ -146,6 +146,7 @@ def instrument_handlers_base(module):
|
|
|
146
146
|
e[1].args[1] if len(
|
|
147
147
|
e[1].args) > 1 \
|
|
148
148
|
else repr(e[1].args[0])]
|
|
149
|
+
|
|
149
150
|
interceptor_error(status_code, errors)
|
|
150
151
|
|
|
151
152
|
return callback
|
|
@@ -202,7 +203,6 @@ def instrument_generic_base(module):
|
|
|
202
203
|
try:
|
|
203
204
|
callback = fn(*args, **kwargs)
|
|
204
205
|
except Exception as e:
|
|
205
|
-
|
|
206
206
|
interceptor_step_error(e, ctx = ctx)
|
|
207
207
|
raise e
|
|
208
208
|
return callback
|
|
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
|