whatap-python 1.8.2__tar.gz → 1.8.4__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.2 → whatap_python-1.8.4}/PKG-INFO +2 -2
- whatap_python-1.8.4/README.md +20 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/setup.py +2 -2
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/agent/linux/amd64/whatap_python +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/agent/linux/arm64/whatap_python +0 -0
- whatap_python-1.8.4/whatap/build.py +4 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_fastapi.py +14 -3
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_flask.py +11 -7
- whatap_python-1.8.4/whatap/trace/mod/application_odoo.py +59 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_wsgi.py +6 -5
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/database_toolkit.py +8 -1
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/trace_module_definition.py +3 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap_python.egg-info/PKG-INFO +2 -2
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap_python.egg-info/SOURCES.txt +1 -0
- whatap_python-1.8.2/README.md +0 -384
- whatap_python-1.8.2/whatap/build.py +0 -4
- {whatap_python-1.8.2 → whatap_python-1.8.4}/setup.cfg +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/LICENSE +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/README.rst +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/__main__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/agent/darwin/amd64/whatap_python +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/agent/darwin/arm64/whatap_python +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/bootstrap/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/bootstrap/sitecustomize.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/conf/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/conf/configuration.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/conf/configure.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/conf/license.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/control/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/counter/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/counter/counter_manager.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/counter/tasks/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/counter/tasks/openfiledescriptor.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/io/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/io/data_inputx.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/io/data_outputx.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/net/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/net/async_sender.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/net/packet_enum.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/net/packet_type_enum.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/net/param_def.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/net/stackhelper.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/net/udp_session.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/net/udp_thread.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/pack/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/pack/logSinkPack.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/pack/pack.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/pack/pack_enum.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/pack/tagCountPack.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/scripts/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/amqp_kombu.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/amqp_pika.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_bottle.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_celery.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_cherrypy.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_django.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_django_asgi.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_django_py3.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_frappe.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_graphql.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_nameko.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_starlette.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/application_tornado.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/database_cxoracle.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/database_mongo.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/database_mysql.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/database_postgresql.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/database_redis.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/email_smtp.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/httpc_django.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/httpc_httplib.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/httpc_requests.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/httpc_urllib3.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/logging.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/mod/plugin.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/simple_trace_context.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/trace_context.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/trace_context_manager.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/trace/trace_import.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/bit_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/cardinality/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/cardinality/hyperloglog.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/cardinality/murmurhash.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/cardinality/registerset.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/compare_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/date_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/debug_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/escape_literal_sql.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/hash_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/hexa32.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/int_set.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/ip_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/keygen.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/linked_list.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/linked_map.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/metering_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/request_double_queue.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/request_queue.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/string_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/throttle_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/util/userid_util.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/__init__.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/blob_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/boolean_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/decimal_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/double_summary.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/double_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/float_array.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/float_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/int_array.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/ip4_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/list_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/long_array.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/long_summary.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/map_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/null_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/number_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/summary_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/text_array.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/text_hash_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/text_value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/value.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/value/value_enum.py +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap/whatap.conf +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap_python.egg-info/dependency_links.txt +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap_python.egg-info/entry_points.txt +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap_python.egg-info/not-zip-safe +0 -0
- {whatap_python-1.8.2 → whatap_python-1.8.4}/whatap_python.egg-info/top_level.txt +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: whatap-python
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
4
4
|
Summary: Monitoring and Profiling Service
|
|
5
5
|
Home-page: https://www.whatap.io
|
|
6
6
|
Author: whatap
|
|
7
7
|
Author-email: admin@whatap.io
|
|
8
8
|
License: Whatap License
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
10
|
Dynamic: author
|
|
11
11
|
Dynamic: author-email
|
|
12
12
|
Dynamic: description
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Whatap Python Agent
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## 에이전트 구조
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [디렉토리 구조 및 개발환경](./docs/development-environment)
|
|
9
|
+
- [Python 에이전트의 실행 구조 및 통신 흐름 이해](./docs/agent-architecture)
|
|
10
|
+
- [Python 에이전트의 배포](./docs/how-to-release)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 에이전트 프로세스
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- [Python 에이전트의 초기화 작업](./docs/agent-process/0.%20Initialize)
|
|
18
|
+
- [Python 에이전트의 모듈 후킹](./docs/agent-process/1.%20hooking)
|
|
19
|
+
- [Python 에이전트의 카운터 스레드 작동 과정](./docs/agent-process/2.%20counter-thread)
|
|
20
|
+
- [Python 에이전트의 데이터 전송 과정](./docs/agent-process/3.%20udp-communication)
|
|
@@ -18,7 +18,7 @@ setup(name=build.name,
|
|
|
18
18
|
author_email='admin@whatap.io',
|
|
19
19
|
license='Whatap License',
|
|
20
20
|
url='https://www.whatap.io',
|
|
21
|
-
packages=find_packages(
|
|
21
|
+
packages=find_packages(),
|
|
22
22
|
package_data={
|
|
23
23
|
'whatap': ['LICENSE', '*.rst', '*.conf', '*.json', 'agent/*/*/whatap_python']
|
|
24
24
|
},
|
|
@@ -33,6 +33,6 @@ setup(name=build.name,
|
|
|
33
33
|
],
|
|
34
34
|
},
|
|
35
35
|
zip_safe=False,
|
|
36
|
-
python_requires='>=3.
|
|
36
|
+
python_requires='>=3.6',
|
|
37
37
|
)
|
|
38
38
|
|
|
Binary file
|
|
Binary file
|
|
@@ -256,6 +256,7 @@ def interceptor(fn, dependant, *args, **kwargs):
|
|
|
256
256
|
delattr(dependant, _WHATAP_DICT)
|
|
257
257
|
|
|
258
258
|
async def interceptor_async(fn, dependant, *args, **kwargs):
|
|
259
|
+
sse_imported = False
|
|
259
260
|
if not hasattr(dependant, _WHATAP_DICT):
|
|
260
261
|
return await fn(*args, **kwargs)
|
|
261
262
|
|
|
@@ -310,8 +311,9 @@ async def interceptor_async(fn, dependant, *args, **kwargs):
|
|
|
310
311
|
callback = None
|
|
311
312
|
|
|
312
313
|
try:
|
|
313
|
-
callback = await fn(*args, **kwargs)
|
|
314
314
|
from fastapi.responses import StreamingResponse
|
|
315
|
+
sse_imported = True
|
|
316
|
+
callback = await fn(*args, **kwargs)
|
|
315
317
|
ctx = TraceContextManager.getLocalContext()
|
|
316
318
|
|
|
317
319
|
if isinstance(callback, StreamingResponse) and hasattr(callback, "body_iterator"):
|
|
@@ -341,13 +343,22 @@ async def interceptor_async(fn, dependant, *args, **kwargs):
|
|
|
341
343
|
raise e
|
|
342
344
|
finally:
|
|
343
345
|
ctx = TraceContextManager.getLocalContext()
|
|
344
|
-
if ctx and
|
|
346
|
+
if ctx and sse_imported:
|
|
347
|
+
if not isinstance(callback, StreamingResponse):
|
|
348
|
+
if conf.profile_http_header_enabled:
|
|
349
|
+
sendHeaders(ctx, environ)
|
|
350
|
+
response = whatap_dict.get(_RESPONSE)
|
|
351
|
+
if response and conf.trace_user_enabled:
|
|
352
|
+
if not conf.trace_user_using_ip:
|
|
353
|
+
setUserId(environ, response, ctx._rawuserid)
|
|
354
|
+
end_interceptor(ctx=ctx)
|
|
355
|
+
elif ctx:
|
|
345
356
|
if conf.profile_http_header_enabled:
|
|
346
357
|
sendHeaders(ctx, environ)
|
|
347
358
|
response = whatap_dict.get(_RESPONSE)
|
|
348
359
|
if response and conf.trace_user_enabled:
|
|
349
360
|
if not conf.trace_user_using_ip:
|
|
350
|
-
setUserId(environ, response, ctx._rawuserid
|
|
361
|
+
setUserId(environ, response, ctx._rawuserid)
|
|
351
362
|
end_interceptor(ctx=ctx)
|
|
352
363
|
if hasattr(dependant, _WHATAP_DICT):
|
|
353
364
|
delattr(dependant, _WHATAP_DICT)
|
|
@@ -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()
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: whatap-python
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
4
4
|
Summary: Monitoring and Profiling Service
|
|
5
5
|
Home-page: https://www.whatap.io
|
|
6
6
|
Author: whatap
|
|
7
7
|
Author-email: admin@whatap.io
|
|
8
8
|
License: Whatap License
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
10
|
Dynamic: author
|
|
11
11
|
Dynamic: author-email
|
|
12
12
|
Dynamic: description
|
|
@@ -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
|
whatap_python-1.8.2/README.md
DELETED
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
[](https://www.whatap.io/)
|
|
2
|
-
# WhaTap for python
|
|
3
|
-
|
|
4
|
-
Whatap allows for application performance monitoring.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# 개발 환경 : python 3.3.0 / go 1.8.3 (osX)
|
|
8
|
-
# git branch : proto(개발환경) / master(배포)
|
|
9
|
-
|
|
10
|
-
MacOS 환경에서 Python Agent 개발 환경 구성
|
|
11
|
-
|
|
12
|
-
Python Agent 샘플 구성 : php-apm + python-apm + python-sample
|
|
13
|
-
|
|
14
|
-
# 디렉토리 구성
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
python-agent-test
|
|
18
|
-
- php-apm # git repository clone
|
|
19
|
-
- python-apm # git repository clone
|
|
20
|
-
- python-sample # git repository clone
|
|
21
|
-
- env # pyen + pyvenv
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
# 개발 환경 구성
|
|
25
|
-
|
|
26
|
-
## 테스트 디렉토리 생성
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
$ mkdir python-agent-test
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## git repository clone
|
|
33
|
-
WORDING_DIR: python-agent-test
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
$ git clone http://gitlab.whatap.io:8888/whatap-inc/php-apm.git
|
|
37
|
-
$ git clone http://gitlab.whatap.io:8888/whatap-inc/python-apm.git
|
|
38
|
-
$ git clone http://gitlab.whatap.io:8888/whatap-inc/python-sample.git
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### git pull 시 에러 해결
|
|
42
|
-
|
|
43
|
-
Failed with error: RPC failed; curl 18 transfer closed with outstanding read data remaining The remote end hung up unexpectedly The remote end hung up unexpectedly
|
|
44
|
-
|
|
45
|
-
- git clone depth 옵션 사용
|
|
46
|
-
git clone –depth [숫자] [주소] : 프로젝트가 많은 커밋들을 가지고 있을 경우 내려받는데 오래 걸리므로 depth 옵션을 사용하면 해당 숫자만큼의 최신 커밋들만 가지고 프로젝트를 내려받는다.
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
$ git clone http://gitlab.whatap.io:8888/whatap-inc/python-apm.git --depth 1
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
- git Http postBuffer size 변경
|
|
53
|
-
Http postBuffer size를 늘려준다.
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
$ git config --global http.postBuffer 524288000
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## brew를 통해 의존성 패키지 설치
|
|
60
|
-
|
|
61
|
-
### brew(mac용 패키지 관리자) 설치
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### brew 업데이트
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
$ brew update
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
### brew를 통해 의존성 패키지 설치
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
$ brew install readline xz mysql-client postgresql
|
|
78
|
-
$ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
|
|
79
|
-
$ source ~/.bash_profile
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
설치가 되지 않으면 다음으로 재시도
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
$ brew reinstall readline xz mysql-client postgresql
|
|
86
|
-
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## go 설치
|
|
91
|
-
```
|
|
92
|
-
$ brew search go # go 설치 가능한 목록 확인
|
|
93
|
-
$ brew install go@1.8 # go 설치
|
|
94
|
-
$ go env # go 설치 환경 확인
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### go 버전이 맞지 않는 경우
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
$ echo 'export PATH="/usr/local/opt/go@1.8/bin:$PATH"' >> ~/.bash_profile
|
|
101
|
-
$ source ~/.bash_profile
|
|
102
|
-
$ go env
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### go path 설정 및 의존성 패키지 설치
|
|
106
|
-
WORDING_DIR: php-apm/php.agent.go
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
$ echo 'export GOPATH='$(pwd) >> ~/.bash_profile
|
|
110
|
-
$ source ~/.bash_profile
|
|
111
|
-
$ cd src/whatap
|
|
112
|
-
$ go get #의존성 패키지 설치
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### go compile 테스트
|
|
116
|
-
WORDING_DIR: python-apm
|
|
117
|
-
|
|
118
|
-
컴파일 후 agent디렉토리에 생성되는 내용을 확인한다.
|
|
119
|
-
디렉토리가 비어있는 경우는 컴파일이 제대로 되지 않았음을 의미한다.
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
$ ./compile_goagent.sh $GOPATH
|
|
123
|
-
---------------------------------------------------------------
|
|
124
|
-
[RESULT]
|
|
125
|
-
---------------------------------------------------------------
|
|
126
|
-
~/python-sample/whatap/agent/darwin:
|
|
127
|
-
total 0
|
|
128
|
-
drwxr-xr-x 4 kimjihye staff 136 Dec 14 17:42 .
|
|
129
|
-
drwxr-xr-x 4 kimjihye staff 136 Dec 14 17:42 ..
|
|
130
|
-
drwxr-xr-x 3 kimjihye staff 102 Dec 14 17:42 amd64
|
|
131
|
-
drwxr-xr-x 3 kimjihye staff 102 Dec 14 17:42 arm64
|
|
132
|
-
|
|
133
|
-
~/python-sample/whatap/agent/linux:
|
|
134
|
-
total 0
|
|
135
|
-
drwxr-xr-x 4 kimjihye staff 136 Dec 14 17:42 .
|
|
136
|
-
drwxr-xr-x 4 kimjihye staff 136 Dec 14 17:42 ..
|
|
137
|
-
drwxr-xr-x 3 kimjihye staff 102 Dec 14 17:42 amd64
|
|
138
|
-
drwxr-xr-x 3 kimjihye staff 102 Dec 14 17:42 arm64
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## pyenv 설치 및 파이썬 버전 설치
|
|
143
|
-
파이썬 버전을 관리하는 툴.
|
|
144
|
-
하나의 컴퓨터에 다양한 파이썬 버전을 설치하고 관리.
|
|
145
|
-
```
|
|
146
|
-
$ brew install pyenv
|
|
147
|
-
|
|
148
|
-
$ pyenv —version # 버전 확인
|
|
149
|
-
|
|
150
|
-
$ pyenv install -list # 설치 가능한 파이썬 목록 확인.x
|
|
151
|
-
$ pyenv install 3.3.0 # 개발 환경에 필요한 파이썬 버전을 설치
|
|
152
|
-
$ pyenv versions # 설치되어 있는 파이썬 버전들 확인
|
|
153
|
-
$ pyenv version # 현재 설정되어 있는 파이썬 버전
|
|
154
|
-
$ pyenv global 3.3.0 # 설치되어 있는 파이썬 버전을 현재 사용할 파이썬 버전으로 설정
|
|
155
|
-
$ python -V # 파이썬 버전 확인
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## 특정 버전의 python으로 alias설정
|
|
159
|
-
WORDING_DIR: HOME (cd)
|
|
160
|
-
|
|
161
|
-
파이선 버전이 변경되지 않는 경우 수동으로 alias 를 등록해준다.
|
|
162
|
-
|
|
163
|
-
```
|
|
164
|
-
$ .pyenv/shims/python -V #pyenv의 파이썬 버전 확인
|
|
165
|
-
|
|
166
|
-
$ echo 'export PATH="[ABSOLUTE_PATH]/.pyenv/shims/python"' >> ~/.bash_profile
|
|
167
|
-
|
|
168
|
-
$ source ~/.bash_profile
|
|
169
|
-
|
|
170
|
-
$ python -V
|
|
171
|
-
Python 3.3.0
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## 가상 환경 생성 (python3에 내장되어 있는 pyvenv 를 이용)
|
|
175
|
-
WORDING_DIR: python-agent-test
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
$ python -m venv env # 가상 환경 디렉토리 만들기
|
|
179
|
-
$ . env/bin/activate # 가상 환경 사용
|
|
180
|
-
(env) $ python -V # 가상환경 파이썬 버전 확인
|
|
181
|
-
$ deactivate # 가상 환경 빠져나오기
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
# pip 설치 및 버전 확인
|
|
185
|
-
이때 pip와 연결된 python버전을 꼭 확인한다.
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
$ . env/bin/activate # 가상 환경 사용
|
|
189
|
-
(env) $ easy_install pip
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
(env) $ pip -V
|
|
193
|
-
pip 18.1 from /Library/Python/2.7/site-packages/pip-18.1-py2.7.egg/pip (python 2.7)
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## python 버전이 맞지 않는 경우 다음으로 버전을 확인한다.
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
$ python -V # 먼저 파이썬 버전 확인
|
|
200
|
-
(env) $ python -m pip -V # 해당 파이썬 버전에 한한 pip 버전 확인
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
## 필수 패키지 설치
|
|
204
|
-
python-apm 과 python-sample 디렉토리에 각각 설치 한다.
|
|
205
|
-
|
|
206
|
-
```
|
|
207
|
-
(env) $ python -m pip install -r requirements.txt
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
# 에이전트와 샘플 애플리케이션 실행
|
|
212
|
-
|
|
213
|
-
## 에이전트 실행 명령어 제공을 위한 스크립트 생성(create pip script)
|
|
214
|
-
WORDING_DIR: python-apm
|
|
215
|
-
|
|
216
|
-
```shell
|
|
217
|
-
(env) $ python setup.py build
|
|
218
|
-
(env) $ python setup.py develop
|
|
219
|
-
...
|
|
220
|
-
|
|
221
|
-
whatap-python 0.1.73 is already the active version in easy-install.pth
|
|
222
|
-
Installing whatap-stop-agent script to /Users/mk/.pyenv/versions/3.3.0/bin
|
|
223
|
-
Installing whatap-setting-config script to /Users/mk/.pyenv/versions/3.3.0/bin
|
|
224
|
-
Installing whatap-start-batch-agent script to /Users/mk/.pyenv/versions/3.3.0/bin
|
|
225
|
-
Installing whatap-start-agent script to /Users/mk/.pyenv/versions/3.3.0/bin
|
|
226
|
-
...
|
|
227
|
-
|
|
228
|
-
(env) $ whatap-start-agent # pip script 확인
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
## 에이전트 실행 명령어를 찾지 못하는경우
|
|
232
|
-
다음 경로를 추가 합니다.
|
|
233
|
-
|
|
234
|
-
```shell
|
|
235
|
-
(env) $ echo 'export PATH="[ABSOLUTE_PATH]/.pyenv/versions/3.3.0/bin:$PATH"' >> ~/.bash_profile
|
|
236
|
-
|
|
237
|
-
(env) $ source ~/.bash_profile
|
|
238
|
-
(env) $ whatap-start-agent # command 확인
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
## 샘플 애플리케이션 시작
|
|
242
|
-
WORDING_DIR: python-sample
|
|
243
|
-
|
|
244
|
-
start.sh 스크립트를 열어 workspace의 경로를 변경해주어야 한다. (dir path: python-agent-test)
|
|
245
|
-
|
|
246
|
-
```shell
|
|
247
|
-
(env) $ ./start.sh
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
## 샘플 애플리케이션 동작 확인
|
|
251
|
-
브라우저에서 다음 페이지가 정상적으로 열리는지 확인한다.
|
|
252
|
-
|
|
253
|
-
```shell
|
|
254
|
-
http://127.0.0.1:8000/test
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
## 샘플 애플리케이션에 트랜잭션 발생
|
|
258
|
-
curl 명령어를 통해 트랜잭션을 발생 시킬 수 있다.
|
|
259
|
-
|
|
260
|
-
```shell
|
|
261
|
-
curl http://127.0.0.1:8000/test
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
shell script를 실행하여 트랜잭션을 발생시킬 수 있다.
|
|
265
|
-
단, 테스트 url이 localhost.whatap.io로 지정되어 있기 때문에
|
|
266
|
-
다음 처럼 hosts 파일에 localhost.whatap.io가 등록되어 있어야 한다.
|
|
267
|
-
|
|
268
|
-
```shell
|
|
269
|
-
$ sudo vi /etc/hosts # hosts 에 등록
|
|
270
|
-
127.0.0.1 localhost.whatap.io
|
|
271
|
-
|
|
272
|
-
$ sh test-shellscript/ab-test.sh
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
## log 확인
|
|
276
|
-
로그 파일 종류: whatap-hook.log(데이터 추적-hooing) & whatap-boot-[DATE].log(데이터 전송)
|
|
277
|
-
|
|
278
|
-
```shell
|
|
279
|
-
$ ls local_test/logs
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
# Deploy
|
|
284
|
-
|
|
285
|
-
## 버전 정책
|
|
286
|
-
실제 배포 되는 버전 정책은 Test Pypi(dev환경)과 Pypi(production환경)을 분리하여 다음 파일로 관리한다.
|
|
287
|
-
파일명: ~/python-apm/whatap/build.py
|
|
288
|
-
|
|
289
|
-
### Test Pypi(dev환경)
|
|
290
|
-
|
|
291
|
-
* https://testpypi.python.org/pypi
|
|
292
|
-
* 접속정보는 위키 및 .pypirc 파일 참고
|
|
293
|
-
* 배포 전 whatap/build.py 버전을 올려야 합니다.
|
|
294
|
-
```shell
|
|
295
|
-
version = '0.1.dev[xxx]'
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### Pypi(production환경
|
|
299
|
-
* https://pypi.python.org/pypi
|
|
300
|
-
* 접속정보는 위키 및 .pypirc 파일 참고
|
|
301
|
-
* 배포 전 whatap/build.py 버전을 올려야 합니다.
|
|
302
|
-
|
|
303
|
-
```shell
|
|
304
|
-
version = '0.1.[xxx]'
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
### 최초 등록
|
|
309
|
-
|
|
310
|
-
```shell
|
|
311
|
-
$ python setup.py register -r pypi 혹은 testpypi # 최초 패키지 등록. 필요에 따라 testpypi 등록
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
## python 명령어 사용
|
|
315
|
-
|
|
316
|
-
#### 빌드
|
|
317
|
-
|
|
318
|
-
```shell
|
|
319
|
-
$ python setup.py build
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
## update go agent
|
|
323
|
-
* 스크립트 실행 위치는 python-apm/이어야 합니다.
|
|
324
|
-
* 최신으로 컴파일을 원하는 경우 php-apm(branch: master) 코드를 최신으로 유지하여야 합니다.
|
|
325
|
-
* go_path는 php.agent.go 경로를 지정한다.
|
|
326
|
-
|
|
327
|
-
```shell
|
|
328
|
-
$ ./compile_goagent.sh [go_path]
|
|
329
|
-
|
|
330
|
-
ex) ./compile_goagent.sh $GOPATH
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
## packaging & distribution
|
|
335
|
-
* 스크립트 실행 위치는 python-apm/이어야 합니다.
|
|
336
|
-
|
|
337
|
-
```shell
|
|
338
|
-
$ ./deploy_pypi.sh [target version is_compile_goagent is_upload]
|
|
339
|
-
|
|
340
|
-
ex) ./deploy_pypi.sh testpypi `date +%s` true true
|
|
341
|
-
ex) ./deploy_pypi.sh pypi `date +%s` true true
|
|
342
|
-
```
|
|
343
|
-
### 사용 예
|
|
344
|
-
ex)
|
|
345
|
-
|
|
346
|
-
```shell
|
|
347
|
-
./compile_goagent.sh $GOPATH
|
|
348
|
-
./deploy_pypi.sh testpypi 0.0.1dev231 true
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
# Dir Structure
|
|
352
|
-
|
|
353
|
-
## TOP Dir Structure
|
|
354
|
-
|
|
355
|
-
- whatap # 에이전트 디렉토리 (only Hooking + UDP)
|
|
356
|
-
- whatap_dev # 에이전트 디렉토리 (Hooking + TCP 수집서버로 전송) => 이전 버전으로 현재 사용 안됨.
|
|
357
|
-
- README.md # 개발 환경에 대한 설명
|
|
358
|
-
- compile_goagent.sh # Go Agent 크로스 컴파일 쉘 스크립트
|
|
359
|
-
- deploy_pypi.sh # pypi 서버 배포 쉘 스크립트
|
|
360
|
-
- requirements.txt # 파이썬 의존성 패키지 설치 목록
|
|
361
|
-
- setup.cfg # 설정 값 관리
|
|
362
|
-
- setup.py # whatap dir 패키징을 위한 정의
|
|
363
|
-
- setup_dev.py # whatap_dev dir 패키징을 위한 정의
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
## whatap Dir Structure
|
|
367
|
-
|
|
368
|
-
- agent # 크로스 컴파일된 GO Agent
|
|
369
|
-
- bootstrap # Python Agent start point (Hook)
|
|
370
|
-
- conf # Python Agent 설정
|
|
371
|
-
- control # Python Agent 제어
|
|
372
|
-
- io # byte 변환
|
|
373
|
-
- net # UDP 통신 (packet 전송)
|
|
374
|
-
- pack # UDP 통신에 전송되는 Pack byte 변환 & type
|
|
375
|
-
- scripts # Python console scripts start point (setup.py 파일 참고)
|
|
376
|
-
- trace # 트랜잭션 추적
|
|
377
|
-
- util # 유틸리티
|
|
378
|
-
- value # 데이터 타입
|
|
379
|
-
- LICENSE
|
|
380
|
-
- README.rst
|
|
381
|
-
- __init__.py
|
|
382
|
-
- __main__.py
|
|
383
|
-
- build.py # 빌드 버전
|
|
384
|
-
- whatap.conf # 기본 설정 파일
|
|
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
|