whatap-python 1.7.5__tar.gz → 1.7.6__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.

Files changed (129) hide show
  1. {whatap_python-1.7.5 → whatap_python-1.7.6}/PKG-INFO +1 -1
  2. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/agent/linux/amd64/whatap_python +0 -0
  3. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/agent/linux/arm64/whatap_python +0 -0
  4. whatap_python-1.7.6/whatap/build.py +4 -0
  5. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/conf/configuration.py +2 -0
  6. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_celery.py +20 -5
  7. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/logging.py +37 -2
  8. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/trace_context.py +8 -6
  9. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap_python.egg-info/PKG-INFO +1 -1
  10. whatap_python-1.7.5/whatap/build.py +0 -4
  11. {whatap_python-1.7.5 → whatap_python-1.7.6}/README.md +0 -0
  12. {whatap_python-1.7.5 → whatap_python-1.7.6}/setup.cfg +0 -0
  13. {whatap_python-1.7.5 → whatap_python-1.7.6}/setup.py +0 -0
  14. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/LICENSE +0 -0
  15. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/README.rst +0 -0
  16. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/__init__.py +0 -0
  17. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/__main__.py +0 -0
  18. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/agent/darwin/amd64/whatap_python +0 -0
  19. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/agent/darwin/arm64/whatap_python +0 -0
  20. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/bootstrap/__init__.py +0 -0
  21. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/bootstrap/sitecustomize.py +0 -0
  22. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/conf/__init__.py +0 -0
  23. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/conf/configure.py +0 -0
  24. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/conf/license.py +0 -0
  25. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/control/__init__.py +0 -0
  26. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/counter/__init__.py +0 -0
  27. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/counter/counter_manager.py +0 -0
  28. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/counter/tasks/__init__.py +0 -0
  29. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/counter/tasks/openfiledescriptor.py +0 -0
  30. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/io/__init__.py +0 -0
  31. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/io/data_inputx.py +0 -0
  32. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/io/data_outputx.py +0 -0
  33. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/net/__init__.py +0 -0
  34. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/net/async_sender.py +0 -0
  35. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/net/packet_enum.py +0 -0
  36. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/net/packet_type_enum.py +0 -0
  37. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/net/param_def.py +0 -0
  38. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/net/stackhelper.py +0 -0
  39. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/net/udp_session.py +0 -0
  40. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/net/udp_thread.py +0 -0
  41. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/pack/__init__.py +0 -0
  42. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/pack/logSinkPack.py +0 -0
  43. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/pack/pack.py +0 -0
  44. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/pack/pack_enum.py +0 -0
  45. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/pack/tagCountPack.py +0 -0
  46. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/scripts/__init__.py +0 -0
  47. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/__init__.py +0 -0
  48. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/__init__.py +0 -0
  49. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/amqp_kombu.py +0 -0
  50. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/amqp_pika.py +0 -0
  51. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_bottle.py +0 -0
  52. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_cherrypy.py +0 -0
  53. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_django.py +0 -0
  54. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_django_asgi.py +0 -0
  55. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_django_py3.py +0 -0
  56. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_fastapi.py +0 -0
  57. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_flask.py +0 -0
  58. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_frappe.py +0 -0
  59. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_graphql.py +0 -0
  60. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_nameko.py +0 -0
  61. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_tornado.py +0 -0
  62. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/application_wsgi.py +0 -0
  63. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/database_cxoracle.py +0 -0
  64. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/database_mongo.py +0 -0
  65. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/database_mysql.py +0 -0
  66. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/database_postgresql.py +0 -0
  67. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/database_redis.py +0 -0
  68. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/database_toolkit.py +0 -0
  69. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/email_smtp.py +0 -0
  70. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/httpc_django.py +0 -0
  71. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/httpc_httplib.py +0 -0
  72. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/httpc_requests.py +0 -0
  73. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/httpc_urllib3.py +0 -0
  74. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/mod/plugin.py +0 -0
  75. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/simple_trace_context.py +0 -0
  76. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/trace_context_manager.py +0 -0
  77. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/trace_import.py +0 -0
  78. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/trace/trace_module_definition.py +0 -0
  79. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/__init__.py +0 -0
  80. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/bit_util.py +0 -0
  81. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/cardinality/__init__.py +0 -0
  82. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/cardinality/hyperloglog.py +0 -0
  83. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/cardinality/murmurhash.py +0 -0
  84. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/cardinality/registerset.py +0 -0
  85. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/compare_util.py +0 -0
  86. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/date_util.py +0 -0
  87. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/debug_util.py +0 -0
  88. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/escape_literal_sql.py +0 -0
  89. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/hash_util.py +0 -0
  90. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/hexa32.py +0 -0
  91. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/int_set.py +0 -0
  92. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/ip_util.py +0 -0
  93. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/keygen.py +0 -0
  94. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/linked_list.py +0 -0
  95. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/linked_map.py +0 -0
  96. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/metering_util.py +0 -0
  97. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/request_double_queue.py +0 -0
  98. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/request_queue.py +0 -0
  99. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/string_util.py +0 -0
  100. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/throttle_util.py +0 -0
  101. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/util/userid_util.py +0 -0
  102. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/__init__.py +0 -0
  103. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/blob_value.py +0 -0
  104. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/boolean_value.py +0 -0
  105. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/decimal_value.py +0 -0
  106. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/double_summary.py +0 -0
  107. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/double_value.py +0 -0
  108. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/float_array.py +0 -0
  109. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/float_value.py +0 -0
  110. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/int_array.py +0 -0
  111. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/ip4_value.py +0 -0
  112. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/list_value.py +0 -0
  113. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/long_array.py +0 -0
  114. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/long_summary.py +0 -0
  115. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/map_value.py +0 -0
  116. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/null_value.py +0 -0
  117. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/number_value.py +0 -0
  118. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/summary_value.py +0 -0
  119. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/text_array.py +0 -0
  120. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/text_hash_value.py +0 -0
  121. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/text_value.py +0 -0
  122. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/value.py +0 -0
  123. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/value/value_enum.py +0 -0
  124. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap/whatap.conf +0 -0
  125. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap_python.egg-info/SOURCES.txt +0 -0
  126. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap_python.egg-info/dependency_links.txt +0 -0
  127. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap_python.egg-info/entry_points.txt +0 -0
  128. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap_python.egg-info/not-zip-safe +0 -0
  129. {whatap_python-1.7.5 → whatap_python-1.7.6}/whatap_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: whatap-python
3
- Version: 1.7.5
3
+ Version: 1.7.6
4
4
  Summary: Monitoring and Profiling Service
5
5
  Home-page: https://www.whatap.io
6
6
  Author: whatap
@@ -0,0 +1,4 @@
1
+ app = 'Python'
2
+ name = 'whatap-python'
3
+ version = '1.7.6'
4
+ release_date = '20250304'
@@ -6,7 +6,9 @@ Configuration = {
6
6
  "trace_user_enabled": True,
7
7
  "trace_user_using_ip": True,
8
8
  "trace_logging_enabled": False,
9
+ "trace_logging_mtid_enabled": False,
9
10
  "trace_loguru_enabled": False,
11
+ "trace_loguru_mtid_enabled": False,
10
12
  "trace_ignore_url_set": [],
11
13
  "trace_ignore_url_prefix": None,
12
14
 
@@ -19,6 +19,7 @@ def interceptor(fn, task_name, *args, **kwargs):
19
19
  return callback
20
20
  except Exception as e:
21
21
  interceptor_step_error(e)
22
+ raise e
22
23
  finally:
23
24
  if ctx:
24
25
  end_interceptor(ctx=ctx)
@@ -27,14 +28,28 @@ def trace_handler(fn, start=False):
27
28
  def handler(func):
28
29
  @wraps(func)
29
30
  def wrapper(*args, **kwargs):
31
+
30
32
  ctx = TraceContextManager.getLocalContext()
33
+
31
34
  if not start and not ctx:
32
35
  return fn(*args, **kwargs)
33
- if ctx and ctx.error_step:
34
- end_interceptor(ctx=ctx)
35
- raise Exception(ctx.error_step)
36
- callback = func(*args, **kwargs)
37
- return callback
36
+
37
+ try:
38
+ callback = func(*args, **kwargs)
39
+ except Exception as e:
40
+ ctx = TraceContextManager.getLocalContext()
41
+ if ctx and ctx.error_step == e:
42
+ ctx.error_step = None
43
+ raise e
44
+ raise
45
+ else:
46
+ ctx = TraceContextManager.getLocalContext()
47
+ if ctx and ctx.error_step:
48
+ e = ctx.error_step
49
+ ctx.error_step = None
50
+ raise e
51
+ return callback
52
+
38
53
  return wrapper
39
54
 
40
55
  return handler
@@ -20,11 +20,25 @@ def instrument_loguru(module):
20
20
  if not ctx:
21
21
  return fn(*args, **kwargs)
22
22
 
23
+ record = args[1]
24
+
25
+ if conf.trace_logging_mtid_enabled and ctx and hasattr(ctx, 'mtid') and ctx.mtid:
26
+ original_message = record["message"]
27
+ try:
28
+ record["message"] = original_message + f" (@mtid: {ctx.mtid})"
29
+
30
+ result = fn(*args, **kwargs)
31
+ record["message"] = original_message
32
+
33
+ return result
34
+ except Exception as e:
35
+ record["message"] = original_message
36
+
23
37
  category = "AppLog"
24
38
  tags = {'@txid': str(ctx.id)} if ctx is not None else {}
25
39
 
26
40
  filename = None
27
- record = args[1]
41
+ # record = args[1]
28
42
  levelname = record["level"].name
29
43
  msg = record["message"]
30
44
  fields = {"filename": filename}
@@ -63,11 +77,32 @@ def instrument_logging(module):
63
77
  ctx = TraceContextManager.getLocalContext()
64
78
  record = args[1]
65
79
 
80
+ if conf.trace_logging_mtid_enabled and ctx and hasattr(ctx, 'mtid') and ctx.mtid:
81
+ original_msg = record.msg
82
+ original_args = record.args
83
+ try:
84
+ if isinstance(record.msg, str):
85
+ if record.args:
86
+ # 포맷 문자열이 있는 경우, 원본 포맷팅을 먼저 수행
87
+ formatted_msg = record.msg % record.args
88
+ record.msg = formatted_msg
89
+ record.args = () # args를 비워줌
90
+ record.msg = record.msg + f" (@mtid: {ctx.mtid})"
91
+
92
+ result = fn(*args, **kwargs)
93
+
94
+ record.msg = original_msg
95
+ record.args = original_args
96
+
97
+ return result
98
+ except Exception as e:
99
+ record.msg = original_msg
100
+ record.args = original_args
101
+
66
102
  ##1.3.6 Backward Compatibility
67
103
  setattr(record, "txid", None)
68
104
 
69
105
  if not ctx:
70
-
71
106
  return fn(*args, **kwargs)
72
107
 
73
108
  instance = args[0]
@@ -10,6 +10,7 @@ from whatap.util.linked_map import LinkedMap
10
10
  from resource import getrusage, RUSAGE_SELF
11
11
  import os
12
12
 
13
+
13
14
  class TraceContext(object):
14
15
  transfer_id = None
15
16
  transfer_info = None
@@ -24,7 +25,7 @@ class TraceContext(object):
24
25
  self.thread = threading.current_thread()
25
26
  self.thread_id = self.thread.ident
26
27
  TraceContextManager.start(self)
27
-
28
+
28
29
  self.pid = os.getpid()
29
30
 
30
31
  self.start_time = 0
@@ -32,7 +33,7 @@ class TraceContext(object):
32
33
  self.start_malloc = 0
33
34
 
34
35
  self.status = 0
35
- self.asgi_response= None
36
+ self.asgi_response = None
36
37
  self.service_hash = 0
37
38
  self.service_name = ''
38
39
  self.remoteIp = ''
@@ -97,7 +98,7 @@ class TraceContext(object):
97
98
  self.db_opening = False
98
99
  self.socket_connecting = False
99
100
 
100
- self.mcaller_url_hash= 0
101
+ self.mcaller_url_hash = 0
101
102
 
102
103
  self.lctx = {}
103
104
  self.is_ignored = False
@@ -135,7 +136,7 @@ class TraceContext(object):
135
136
  sb = []
136
137
  sb.append(str(conf.mtrace_spec))
137
138
  sb.append(str(self.service_hash))
138
-
139
+
139
140
  transfer_info = ','.join(sb)
140
141
  return transfer_info
141
142
 
@@ -157,13 +158,14 @@ class TraceContext(object):
157
158
  x = headerString.index(',')
158
159
  s1 = headerString[0: x]
159
160
  self.mcaller_spec = s1
160
- self.mcaller_url_hash = headerString[x + 1: ]
161
+ self.mcaller_url_hash = headerString[x + 1:]
161
162
 
162
163
  def setTxid(self, myid):
163
164
  self.id = Hexa32.toLong32(myid)
164
165
 
165
166
  def transferPOID(self):
166
167
  if not self.transfer_poid:
167
- self.transfer_poid = ",".join((Hexa32.toString32(conf.PCODE), Hexa32.toString32(conf.OKIND), Hexa32.toString32(int(conf.OID))))
168
+ self.transfer_poid = ",".join(
169
+ (Hexa32.toString32(conf.PCODE), Hexa32.toString32(conf.OKIND), Hexa32.toString32(int(conf.OID))))
168
170
 
169
171
  return self.transfer_poid
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: whatap-python
3
- Version: 1.7.5
3
+ Version: 1.7.6
4
4
  Summary: Monitoring and Profiling Service
5
5
  Home-page: https://www.whatap.io
6
6
  Author: whatap
@@ -1,4 +0,0 @@
1
- app = 'Python'
2
- name = 'whatap-python'
3
- version = '1.7.5'
4
- release_date = '20250217'
File without changes
File without changes
File without changes