whatap-python 1.6.7__tar.gz → 1.6.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.

Files changed (123) hide show
  1. {whatap_python-1.6.7 → whatap_python-1.6.9}/PKG-INFO +1 -1
  2. whatap_python-1.6.9/whatap/build.py +4 -0
  3. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/conf/configure.py +1 -1
  4. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_graphql.py +35 -13
  5. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_wsgi.py +1 -3
  6. whatap_python-1.6.9/whatap/trace/mod/database_cxoracle.py +28 -0
  7. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/trace_module_definition.py +8 -0
  8. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap_python.egg-info/PKG-INFO +1 -1
  9. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap_python.egg-info/SOURCES.txt +1 -0
  10. whatap_python-1.6.7/whatap/build.py +0 -4
  11. {whatap_python-1.6.7 → whatap_python-1.6.9}/README.md +0 -0
  12. {whatap_python-1.6.7 → whatap_python-1.6.9}/setup.cfg +0 -0
  13. {whatap_python-1.6.7 → whatap_python-1.6.9}/setup.py +0 -0
  14. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/LICENSE +0 -0
  15. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/README.rst +0 -0
  16. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/__init__.py +0 -0
  17. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/__main__.py +0 -0
  18. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/agent/darwin/amd64/whatap_python +0 -0
  19. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/agent/darwin/arm64/whatap_python +0 -0
  20. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/agent/linux/amd64/whatap_python +0 -0
  21. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/agent/linux/arm64/whatap_python +0 -0
  22. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/bootstrap/__init__.py +0 -0
  23. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/bootstrap/sitecustomize.py +0 -0
  24. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/conf/__init__.py +0 -0
  25. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/conf/configuration.py +0 -0
  26. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/conf/license.py +0 -0
  27. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/control/__init__.py +0 -0
  28. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/io/__init__.py +0 -0
  29. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/io/data_inputx.py +0 -0
  30. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/io/data_outputx.py +0 -0
  31. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/net/__init__.py +0 -0
  32. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/net/async_sender.py +0 -0
  33. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/net/packet_enum.py +0 -0
  34. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/net/packet_type_enum.py +0 -0
  35. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/net/param_def.py +0 -0
  36. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/net/stackhelper.py +0 -0
  37. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/net/udp_session.py +0 -0
  38. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/net/udp_thread.py +0 -0
  39. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/pack/__init__.py +0 -0
  40. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/pack/logSinkPack.py +0 -0
  41. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/pack/pack.py +0 -0
  42. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/pack/pack_enum.py +0 -0
  43. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/scripts/__init__.py +0 -0
  44. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/__init__.py +0 -0
  45. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/__init__.py +0 -0
  46. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/amqp_kombu.py +0 -0
  47. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/amqp_pika.py +0 -0
  48. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_bottle.py +0 -0
  49. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_celery.py +0 -0
  50. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_cherrypy.py +0 -0
  51. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_django.py +0 -0
  52. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_django_py3.py +0 -0
  53. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_fastapi.py +0 -0
  54. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_flask.py +0 -0
  55. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_frappe.py +0 -0
  56. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_nameko.py +0 -0
  57. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/application_tornado.py +0 -0
  58. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/database_mongo.py +0 -0
  59. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/database_mysql.py +0 -0
  60. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/database_postgresql.py +0 -0
  61. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/database_redis.py +0 -0
  62. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/database_toolkit.py +0 -0
  63. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/email_smtp.py +0 -0
  64. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/httpc_django.py +0 -0
  65. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/httpc_httplib.py +0 -0
  66. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/httpc_requests.py +0 -0
  67. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/httpc_urllib3.py +0 -0
  68. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/logging.py +0 -0
  69. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/mod/plugin.py +0 -0
  70. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/simple_trace_context.py +0 -0
  71. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/trace_context.py +0 -0
  72. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/trace_context_manager.py +0 -0
  73. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/trace/trace_import.py +0 -0
  74. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/__init__.py +0 -0
  75. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/bit_util.py +0 -0
  76. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/cardinality/__init__.py +0 -0
  77. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/cardinality/hyperloglog.py +0 -0
  78. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/cardinality/murmurhash.py +0 -0
  79. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/cardinality/registerset.py +0 -0
  80. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/compare_util.py +0 -0
  81. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/date_util.py +0 -0
  82. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/debug_util.py +0 -0
  83. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/escape_literal_sql.py +0 -0
  84. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/hash_util.py +0 -0
  85. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/hexa32.py +0 -0
  86. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/int_set.py +0 -0
  87. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/ip_util.py +0 -0
  88. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/keygen.py +0 -0
  89. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/linked_list.py +0 -0
  90. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/linked_map.py +0 -0
  91. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/metering_util.py +0 -0
  92. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/request_double_queue.py +0 -0
  93. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/request_queue.py +0 -0
  94. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/string_util.py +0 -0
  95. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/throttle_util.py +0 -0
  96. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/util/userid_util.py +0 -0
  97. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/__init__.py +0 -0
  98. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/blob_value.py +0 -0
  99. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/boolean_value.py +0 -0
  100. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/decimal_value.py +0 -0
  101. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/double_summary.py +0 -0
  102. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/double_value.py +0 -0
  103. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/float_array.py +0 -0
  104. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/float_value.py +0 -0
  105. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/int_array.py +0 -0
  106. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/ip4_value.py +0 -0
  107. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/list_value.py +0 -0
  108. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/long_array.py +0 -0
  109. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/long_summary.py +0 -0
  110. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/map_value.py +0 -0
  111. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/null_value.py +0 -0
  112. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/number_value.py +0 -0
  113. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/summary_value.py +0 -0
  114. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/text_array.py +0 -0
  115. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/text_hash_value.py +0 -0
  116. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/text_value.py +0 -0
  117. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/value.py +0 -0
  118. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/value/value_enum.py +0 -0
  119. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap/whatap.conf +0 -0
  120. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap_python.egg-info/dependency_links.txt +0 -0
  121. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap_python.egg-info/entry_points.txt +0 -0
  122. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap_python.egg-info/not-zip-safe +0 -0
  123. {whatap_python-1.6.7 → whatap_python-1.6.9}/whatap_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: whatap-python
3
- Version: 1.6.7
3
+ Version: 1.6.9
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.6.9'
4
+ release_date = '20240903'
@@ -15,7 +15,7 @@ class Configure(object):
15
15
  observers = []
16
16
  POD_NAME = os.environ.get("POD_NAME") if os.environ.get('POD_NAME') else os.environ.get("PODNAME") if os.environ.get("PODNAME") else ''
17
17
  license = None
18
- max_send_queue_size = 1000
18
+ max_send_queue_size = 2000
19
19
 
20
20
  @classmethod
21
21
  def init(cls, display=True):
@@ -6,23 +6,45 @@ from whatap.trace.trace_context_manager import TraceContextManager
6
6
  import whatap.net.async_sender as async_sender
7
7
  from whatap.net.packet_type_enum import PacketTypeEnum
8
8
  from whatap.util.date_util import DateUtil
9
- import re
9
+ import pkg_resources
10
+ from graphql.language.ast import OperationDefinitionNode
11
+
10
12
 
11
13
  def parseServiceName(graphql_doc):
12
- try:
13
- op_def = [
14
- i for i in graphql_doc.definitions
15
- if type(i).__name__ == "OperationDefinition"
16
- ][0]
17
- except KeyError:
18
- return "GraphQL unknown operation"
14
+ # GraphQL-core 버전 확인
15
+ graphql_core_version = pkg_resources.get_distribution("graphql-core").version
16
+
17
+ # GraphQL-core 3.x 이상 버전일 경우
18
+ if graphql_core_version.startswith("3") or graphql_core_version.startswith("4"):
19
+ try:
20
+ # OperationDefinitionNode 타입의 노드 필터링 (3.x 이상 버전 로직)
21
+ op_def = [
22
+ i for i in graphql_doc.definitions
23
+ if isinstance(i, OperationDefinitionNode)
24
+ ][0]
25
+ except (IndexError, KeyError):
26
+ return "GraphQL unknown operation"
27
+
28
+ # operation의 타입이 OperationType Enum인 경우
29
+ op = op_def.operation.value # Enum 값을 문자열로 변환
30
+ else:
31
+ try:
32
+ # 이전 버전 로직 (OperationDefinition 사용)
33
+ op_def = [
34
+ i for i in graphql_doc.definitions
35
+ if type(i).__name__ == "OperationDefinition"
36
+ ][0]
37
+ except (IndexError, KeyError):
38
+ return "GraphQL unknown operation"
39
+
40
+ # operation의 타입이 문자열인 경우
41
+ op = op_def.operation # 문자열 그대로 사용
19
42
 
20
- op = op_def.operation
21
43
  name = op_def.name
22
- fields = op_def.selection_set.selections
23
- if not fields:
24
- fields = []
25
- return "/GraphQL %s %s" % (op.upper(), name.value if name else "+".join([f.name.value for f in fields]))
44
+ fields = op_def.selection_set.selections if op_def.selection_set else []
45
+
46
+ return "/GraphQL %s %s" % (op.upper(), name.value if name else "+".join([f.name.value for f in fields]))
47
+
26
48
 
27
49
  def intercept_execute(fn, *args, **kwargs):
28
50
  ctx = TraceContextManager.getLocalContext()
@@ -380,11 +380,10 @@ def interceptor_db_con(fn, db_type, *args, **kwargs):
380
380
  if not kwargs:
381
381
  kwargs = dict(
382
382
  x.split('=') for x in re.sub(r'\s*=\s*', '=', args[0]).split())
383
- ctx = TraceContextManager.getLocalContext()
384
383
  text = '{}://'.format(db_type)
385
384
  text += kwargs.get('user')
386
385
  text += "@"
387
- text += kwargs.get('host')
386
+ text += kwargs.get('host',kwargs.get('dsn','') )
388
387
  text += '/'
389
388
  text += kwargs.get('database', kwargs.get('db', kwargs.get('dbname', '')))
390
389
  ctx.active_dbc = text
@@ -456,7 +455,6 @@ def interceptor_db_execute(fn, *args, **kwargs):
456
455
  except Exception as e:
457
456
  interceptor_step_error(e)
458
457
  finally:
459
- ctx = TraceContextManager.getLocalContext()
460
458
  datas = [ctx.lctx.get('dbc', ''), query]
461
459
  ctx.elapsed = DateUtil.nowSystem() - start_time
462
460
  async_sender.send_packet(PacketTypeEnum.TX_SQL, ctx,
@@ -0,0 +1,28 @@
1
+ from whatap.trace import get_dict
2
+ from whatap.trace.mod.application_wsgi import trace_handler, \
3
+ interceptor_db_con, interceptor_db_execute, interceptor_db_close
4
+
5
+ def instrument_oracle_client(module):
6
+ def wrapper(fn):
7
+ @trace_handler(fn)
8
+ def trace(*args, **kwargs):
9
+ db_type = 'oracle'
10
+ callback = interceptor_db_con(fn, db_type, *args, **kwargs)
11
+ return callback
12
+
13
+ return trace
14
+ if hasattr(module, "connect"):
15
+ module.connect = wrapper(module.connect)
16
+
17
+ def wrapper(fn):
18
+ @trace_handler(fn)
19
+ def trace(*args, **kwargs):
20
+ callback = interceptor_db_close(fn, *args, **kwargs)
21
+ return callback
22
+
23
+ return trace
24
+
25
+ if hasattr(module, "Connection") and hasattr(module.Connection, "close"):
26
+ get_dict(module.Connection)['close'] = wrapper(
27
+ module.Connection.close)
28
+
@@ -99,6 +99,11 @@ DEFINITION = {
99
99
  ],
100
100
  'application_graphql':[
101
101
  #('graphql','instrument_graphql'),
102
+
103
+ #graphen-core 3.x~
104
+ ('graphql.execution.execute','instrument_graphql'),
105
+
106
+ #graphen-core 2.x
102
107
  ('graphql.execution.executor','instrument_graphql'),
103
108
  ],
104
109
  'database_mongo':[
@@ -117,4 +122,7 @@ DEFINITION = {
117
122
  'application_frappe': [
118
123
  ('frappe.app', 'instrument'),
119
124
  ],
125
+ 'database_cxoracle':[
126
+ ('cx_Oracle', 'instrument_oracle_client'),
127
+ ],
120
128
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: whatap-python
3
- Version: 1.6.7
3
+ Version: 1.6.9
4
4
  Summary: Monitoring and Profiling Service
5
5
  Home-page: https://www.whatap.io
6
6
  Author: whatap
@@ -55,6 +55,7 @@ whatap/trace/mod/application_graphql.py
55
55
  whatap/trace/mod/application_nameko.py
56
56
  whatap/trace/mod/application_tornado.py
57
57
  whatap/trace/mod/application_wsgi.py
58
+ whatap/trace/mod/database_cxoracle.py
58
59
  whatap/trace/mod/database_mongo.py
59
60
  whatap/trace/mod/database_mysql.py
60
61
  whatap/trace/mod/database_postgresql.py
@@ -1,4 +0,0 @@
1
- app = 'Python'
2
- name = 'whatap-python'
3
- version = '1.6.7'
4
- release_date = '20240822'
File without changes
File without changes
File without changes