whatap-python 1.8.3__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.

Files changed (132) hide show
  1. {whatap_python-1.8.3 → whatap_python-1.8.4}/PKG-INFO +2 -2
  2. whatap_python-1.8.4/README.md +20 -0
  3. {whatap_python-1.8.3 → whatap_python-1.8.4}/setup.py +2 -2
  4. whatap_python-1.8.4/whatap/build.py +4 -0
  5. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_fastapi.py +13 -2
  6. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap_python.egg-info/PKG-INFO +2 -2
  7. whatap_python-1.8.3/README.md +0 -384
  8. whatap_python-1.8.3/whatap/build.py +0 -4
  9. {whatap_python-1.8.3 → whatap_python-1.8.4}/setup.cfg +0 -0
  10. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/LICENSE +0 -0
  11. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/README.rst +0 -0
  12. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/__init__.py +0 -0
  13. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/__main__.py +0 -0
  14. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/agent/darwin/amd64/whatap_python +0 -0
  15. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/agent/darwin/arm64/whatap_python +0 -0
  16. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/agent/linux/amd64/whatap_python +0 -0
  17. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/agent/linux/arm64/whatap_python +0 -0
  18. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/bootstrap/__init__.py +0 -0
  19. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/bootstrap/sitecustomize.py +0 -0
  20. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/conf/__init__.py +0 -0
  21. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/conf/configuration.py +0 -0
  22. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/conf/configure.py +0 -0
  23. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/conf/license.py +0 -0
  24. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/control/__init__.py +0 -0
  25. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/counter/__init__.py +0 -0
  26. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/counter/counter_manager.py +0 -0
  27. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/counter/tasks/__init__.py +0 -0
  28. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/counter/tasks/openfiledescriptor.py +0 -0
  29. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/io/__init__.py +0 -0
  30. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/io/data_inputx.py +0 -0
  31. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/io/data_outputx.py +0 -0
  32. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/net/__init__.py +0 -0
  33. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/net/async_sender.py +0 -0
  34. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/net/packet_enum.py +0 -0
  35. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/net/packet_type_enum.py +0 -0
  36. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/net/param_def.py +0 -0
  37. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/net/stackhelper.py +0 -0
  38. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/net/udp_session.py +0 -0
  39. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/net/udp_thread.py +0 -0
  40. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/pack/__init__.py +0 -0
  41. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/pack/logSinkPack.py +0 -0
  42. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/pack/pack.py +0 -0
  43. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/pack/pack_enum.py +0 -0
  44. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/pack/tagCountPack.py +0 -0
  45. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/scripts/__init__.py +0 -0
  46. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/__init__.py +0 -0
  47. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/__init__.py +0 -0
  48. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/amqp_kombu.py +0 -0
  49. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/amqp_pika.py +0 -0
  50. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_bottle.py +0 -0
  51. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_celery.py +0 -0
  52. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_cherrypy.py +0 -0
  53. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_django.py +0 -0
  54. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_django_asgi.py +0 -0
  55. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_django_py3.py +0 -0
  56. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_flask.py +0 -0
  57. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_frappe.py +0 -0
  58. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_graphql.py +0 -0
  59. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_nameko.py +0 -0
  60. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_odoo.py +0 -0
  61. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_starlette.py +0 -0
  62. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_tornado.py +0 -0
  63. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/application_wsgi.py +0 -0
  64. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/database_cxoracle.py +0 -0
  65. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/database_mongo.py +0 -0
  66. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/database_mysql.py +0 -0
  67. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/database_postgresql.py +0 -0
  68. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/database_redis.py +0 -0
  69. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/database_toolkit.py +0 -0
  70. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/email_smtp.py +0 -0
  71. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/httpc_django.py +0 -0
  72. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/httpc_httplib.py +0 -0
  73. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/httpc_requests.py +0 -0
  74. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/httpc_urllib3.py +0 -0
  75. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/logging.py +0 -0
  76. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/mod/plugin.py +0 -0
  77. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/simple_trace_context.py +0 -0
  78. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/trace_context.py +0 -0
  79. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/trace_context_manager.py +0 -0
  80. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/trace_import.py +0 -0
  81. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/trace/trace_module_definition.py +0 -0
  82. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/__init__.py +0 -0
  83. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/bit_util.py +0 -0
  84. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/cardinality/__init__.py +0 -0
  85. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/cardinality/hyperloglog.py +0 -0
  86. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/cardinality/murmurhash.py +0 -0
  87. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/cardinality/registerset.py +0 -0
  88. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/compare_util.py +0 -0
  89. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/date_util.py +0 -0
  90. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/debug_util.py +0 -0
  91. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/escape_literal_sql.py +0 -0
  92. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/hash_util.py +0 -0
  93. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/hexa32.py +0 -0
  94. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/int_set.py +0 -0
  95. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/ip_util.py +0 -0
  96. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/keygen.py +0 -0
  97. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/linked_list.py +0 -0
  98. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/linked_map.py +0 -0
  99. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/metering_util.py +0 -0
  100. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/request_double_queue.py +0 -0
  101. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/request_queue.py +0 -0
  102. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/string_util.py +0 -0
  103. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/throttle_util.py +0 -0
  104. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/util/userid_util.py +0 -0
  105. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/__init__.py +0 -0
  106. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/blob_value.py +0 -0
  107. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/boolean_value.py +0 -0
  108. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/decimal_value.py +0 -0
  109. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/double_summary.py +0 -0
  110. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/double_value.py +0 -0
  111. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/float_array.py +0 -0
  112. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/float_value.py +0 -0
  113. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/int_array.py +0 -0
  114. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/ip4_value.py +0 -0
  115. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/list_value.py +0 -0
  116. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/long_array.py +0 -0
  117. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/long_summary.py +0 -0
  118. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/map_value.py +0 -0
  119. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/null_value.py +0 -0
  120. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/number_value.py +0 -0
  121. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/summary_value.py +0 -0
  122. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/text_array.py +0 -0
  123. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/text_hash_value.py +0 -0
  124. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/text_value.py +0 -0
  125. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/value.py +0 -0
  126. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/value/value_enum.py +0 -0
  127. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap/whatap.conf +0 -0
  128. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap_python.egg-info/SOURCES.txt +0 -0
  129. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap_python.egg-info/dependency_links.txt +0 -0
  130. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap_python.egg-info/entry_points.txt +0 -0
  131. {whatap_python-1.8.3 → whatap_python-1.8.4}/whatap_python.egg-info/not-zip-safe +0 -0
  132. {whatap_python-1.8.3 → 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
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.7
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(exclude=('whatap_dev', 'whatap_dev.*')),
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.7',
36
+ python_requires='>=3.6',
37
37
  )
38
38
 
@@ -0,0 +1,4 @@
1
+ app = 'Python'
2
+ name = 'whatap-python'
3
+ version = '1.8.4'
4
+ release_date = '20250609'
@@ -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
 
@@ -311,6 +312,7 @@ async def interceptor_async(fn, dependant, *args, **kwargs):
311
312
 
312
313
  try:
313
314
  from fastapi.responses import StreamingResponse
315
+ sse_imported = True
314
316
  callback = await fn(*args, **kwargs)
315
317
  ctx = TraceContextManager.getLocalContext()
316
318
 
@@ -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 not isinstance(callback, StreamingResponse):
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)
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: whatap-python
3
- Version: 1.8.3
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.7
9
+ Requires-Python: >=3.6
10
10
  Dynamic: author
11
11
  Dynamic: author-email
12
12
  Dynamic: description
@@ -1,384 +0,0 @@
1
- [![WhaTap Logo](https://www.whatap.io/img/common/whatap_logo_re.svg)](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 # 기본 설정 파일
@@ -1,4 +0,0 @@
1
- app = 'Python'
2
- name = 'whatap-python'
3
- version = '1.8.3'
4
- release_date = '20250519'
File without changes