osprofiler 4.2.0__tar.gz → 4.4.0__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.
Files changed (140) hide show
  1. osprofiler-4.4.0/.pre-commit-config.yaml +25 -0
  2. {osprofiler-4.2.0 → osprofiler-4.4.0}/.zuul.yaml +3 -2
  3. {osprofiler-4.2.0 → osprofiler-4.4.0}/AUTHORS +5 -0
  4. {osprofiler-4.2.0 → osprofiler-4.4.0}/ChangeLog +44 -0
  5. osprofiler-4.4.0/PKG-INFO +75 -0
  6. {osprofiler-4.2.0 → osprofiler-4.4.0}/devstack/README.rst +2 -2
  7. {osprofiler-4.2.0 → osprofiler-4.4.0}/devstack/lib/osprofiler +1 -9
  8. {osprofiler-4.2.0 → osprofiler-4.4.0}/devstack/plugin.sh +2 -3
  9. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/conf.py +12 -12
  10. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/user/similar_projects.rst +1 -1
  11. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/_utils.py +47 -22
  12. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/cmd/cliutils.py +13 -7
  13. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/cmd/commands.py +115 -59
  14. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/cmd/shell.py +29 -19
  15. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/__init__.py +1 -1
  16. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/base.py +101 -73
  17. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/elasticsearch_driver.py +73 -47
  18. osprofiler-4.4.0/osprofiler/drivers/jaeger.py +41 -0
  19. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/loginsight.py +118 -75
  20. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/messaging.py +75 -38
  21. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/mongodb.py +46 -22
  22. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/otlp.py +91 -55
  23. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/redis_driver.py +112 -58
  24. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/drivers/sqlalchemy_driver.py +61 -26
  25. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/exc.py +3 -3
  26. osprofiler-4.4.0/osprofiler/hacking/checks.py +212 -0
  27. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/initializer.py +14 -2
  28. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/notifier.py +26 -15
  29. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/opts.py +97 -57
  30. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/profiler.py +130 -79
  31. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/requests.py +29 -18
  32. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/sqlalchemy.py +45 -28
  33. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/functional/test_driver.py +63 -41
  34. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/test.py +2 -1
  35. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/cmd/test_shell.py +72 -48
  36. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/doc/test_specs.py +40 -22
  37. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/drivers/test_base.py +60 -30
  38. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/drivers/test_elasticsearch.py +44 -44
  39. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/drivers/test_loginsight.py +151 -94
  40. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/drivers/test_messaging.py +25 -16
  41. osprofiler-4.4.0/osprofiler/tests/unit/drivers/test_mongodb.py +375 -0
  42. osprofiler-4.4.0/osprofiler/tests/unit/drivers/test_otlp.py +154 -0
  43. osprofiler-4.4.0/osprofiler/tests/unit/drivers/test_redis_driver.py +394 -0
  44. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/test_initializer.py +11 -6
  45. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/test_notifier.py +2 -3
  46. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/test_opts.py +16 -12
  47. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/test_profiler.py +184 -133
  48. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/test_sqlalchemy.py +37 -20
  49. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/test_utils.py +6 -4
  50. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/unit/test_web.py +73 -69
  51. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/web.py +49 -22
  52. osprofiler-4.4.0/osprofiler.egg-info/PKG-INFO +75 -0
  53. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler.egg-info/SOURCES.txt +5 -1
  54. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler.egg-info/entry_points.txt +0 -1
  55. osprofiler-4.4.0/osprofiler.egg-info/pbr.json +1 -0
  56. osprofiler-4.4.0/osprofiler.egg-info/requires.txt +27 -0
  57. osprofiler-4.4.0/pyproject.toml +93 -0
  58. osprofiler-4.4.0/releasenotes/notes/remove-py38-e2c2723282ebbf9f.yaml +5 -0
  59. osprofiler-4.4.0/releasenotes/notes/remove-py39-d5921efb33a278ca.yaml +5 -0
  60. osprofiler-4.4.0/releasenotes/notes/retire-jaeger-driver-d8add44c5522ad7a.yaml +6 -0
  61. osprofiler-4.4.0/releasenotes/source/_templates/.placeholder +0 -0
  62. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/conf.py +23 -14
  63. osprofiler-4.4.0/setup.cfg +7 -0
  64. {osprofiler-4.2.0 → osprofiler-4.4.0}/setup.py +1 -3
  65. {osprofiler-4.2.0 → osprofiler-4.4.0}/test-requirements.txt +2 -11
  66. {osprofiler-4.2.0 → osprofiler-4.4.0}/tools/lint.py +1 -1
  67. {osprofiler-4.2.0 → osprofiler-4.4.0}/tools/patch_tox_venv.py +16 -11
  68. {osprofiler-4.2.0 → osprofiler-4.4.0}/tox.ini +40 -40
  69. osprofiler-4.2.0/.pre-commit-config.yaml +0 -39
  70. osprofiler-4.2.0/PKG-INFO +0 -62
  71. osprofiler-4.2.0/osprofiler/drivers/jaeger.py +0 -156
  72. osprofiler-4.2.0/osprofiler/hacking/checks.py +0 -382
  73. osprofiler-4.2.0/osprofiler/tests/unit/drivers/test_jaeger.py +0 -110
  74. osprofiler-4.2.0/osprofiler/tests/unit/drivers/test_mongodb.py +0 -321
  75. osprofiler-4.2.0/osprofiler/tests/unit/drivers/test_otlp.py +0 -84
  76. osprofiler-4.2.0/osprofiler/tests/unit/drivers/test_redis_driver.py +0 -332
  77. osprofiler-4.2.0/osprofiler.egg-info/PKG-INFO +0 -62
  78. osprofiler-4.2.0/osprofiler.egg-info/pbr.json +0 -1
  79. osprofiler-4.2.0/osprofiler.egg-info/requires.txt +0 -47
  80. osprofiler-4.2.0/setup.cfg +0 -57
  81. {osprofiler-4.2.0 → osprofiler-4.4.0}/.stestr.conf +0 -0
  82. {osprofiler-4.2.0 → osprofiler-4.4.0}/CONTRIBUTING.rst +0 -0
  83. {osprofiler-4.2.0 → osprofiler-4.4.0}/LICENSE +0 -0
  84. {osprofiler-4.2.0 → osprofiler-4.4.0}/README.rst +0 -0
  85. {osprofiler-4.2.0 → osprofiler-4.4.0}/bindep.txt +0 -0
  86. {osprofiler-4.2.0 → osprofiler-4.4.0}/devstack/settings +0 -0
  87. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/requirements.txt +0 -0
  88. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/Makefile +0 -0
  89. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/index.rst +0 -0
  90. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/user/api.rst +0 -0
  91. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/user/background.rst +0 -0
  92. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/user/collectors.rst +0 -0
  93. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/user/history.rst +0 -0
  94. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/user/index.rst +0 -0
  95. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/source/user/integration.rst +0 -0
  96. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/specs/README.rst +0 -0
  97. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/specs/implemented/README.rst +0 -0
  98. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/specs/implemented/make_paste_ini_config_optional.rst +0 -0
  99. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/specs/implemented/multi_backend_support.rst +0 -0
  100. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/specs/in-progress/README.rst +0 -0
  101. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/specs/in-progress/better_devstack_integration.rst +0 -0
  102. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/specs/in-progress/integration_testing.rst +0 -0
  103. {osprofiler-4.2.0 → osprofiler-4.4.0}/doc/specs/template.rst +0 -0
  104. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/__init__.py +0 -0
  105. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/cmd/__init__.py +0 -0
  106. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/cmd/template.html +0 -0
  107. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/hacking/__init__.py +0 -0
  108. /osprofiler-4.2.0/osprofiler/tests/__init__.py → /osprofiler-4.4.0/osprofiler/py.typed +0 -0
  109. {osprofiler-4.2.0/osprofiler/tests/functional → osprofiler-4.4.0/osprofiler/tests}/__init__.py +0 -0
  110. {osprofiler-4.2.0/osprofiler/tests/unit → osprofiler-4.4.0/osprofiler/tests/functional}/__init__.py +0 -0
  111. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler/tests/functional/config.cfg +0 -0
  112. {osprofiler-4.2.0/osprofiler/tests/unit/cmd → osprofiler-4.4.0/osprofiler/tests/unit}/__init__.py +0 -0
  113. {osprofiler-4.2.0/osprofiler/tests/unit/doc → osprofiler-4.4.0/osprofiler/tests/unit/cmd}/__init__.py +0 -0
  114. {osprofiler-4.2.0/osprofiler/tests/unit/drivers → osprofiler-4.4.0/osprofiler/tests/unit/doc}/__init__.py +0 -0
  115. /osprofiler-4.2.0/releasenotes/source/_static/.placeholder → /osprofiler-4.4.0/osprofiler/tests/unit/drivers/__init__.py +0 -0
  116. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler.egg-info/dependency_links.txt +0 -0
  117. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler.egg-info/not-zip-safe +0 -0
  118. {osprofiler-4.2.0 → osprofiler-4.4.0}/osprofiler.egg-info/top_level.txt +0 -0
  119. {osprofiler-4.2.0 → osprofiler-4.4.0}/playbooks/osprofiler-post.yaml +0 -0
  120. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/add-reno-996dd44974d53238.yaml +0 -0
  121. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/add-requests-profiling-761e09f243d36966.yaml +0 -0
  122. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/drop-jaeger-container-when-unstacking-e8fcdc036f80158a.yaml +0 -0
  123. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/drop-python-2-7-73d3113c69d724d6.yaml +0 -0
  124. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/jaeger-add-process-tags-79d5f5d7a0b049ef.yaml +0 -0
  125. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/jaeger-service-name-prefix-72878a930f700878.yaml +0 -0
  126. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/otlp-driver-cb932038ad580ac2.yaml +0 -0
  127. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/redis-improvement-d4c91683fc89f570.yaml +0 -0
  128. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/notes/remove-strict-redis-9eb43d30c9c1fc43.yaml +0 -0
  129. {osprofiler-4.2.0/releasenotes/source/_templates → osprofiler-4.4.0/releasenotes/source/_static}/.placeholder +0 -0
  130. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/index.rst +0 -0
  131. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/ocata.rst +0 -0
  132. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/pike.rst +0 -0
  133. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/queens.rst +0 -0
  134. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/rocky.rst +0 -0
  135. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/stein.rst +0 -0
  136. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/train.rst +0 -0
  137. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/unreleased.rst +0 -0
  138. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/ussuri.rst +0 -0
  139. {osprofiler-4.2.0 → osprofiler-4.4.0}/releasenotes/source/victoria.rst +0 -0
  140. {osprofiler-4.2.0 → osprofiler-4.4.0}/requirements.txt +0 -0
@@ -0,0 +1,25 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: mixed-line-ending
7
+ args: ['--fix', 'lf']
8
+ exclude: '.*\.(svg)$'
9
+ - id: fix-byte-order-marker
10
+ - id: check-executables-have-shebangs
11
+ - id: check-merge-conflict
12
+ - id: debug-statements
13
+ - id: check-yaml
14
+ files: .*\.(yaml|yml)$
15
+ - repo: https://github.com/astral-sh/ruff-pre-commit
16
+ rev: v0.15.5
17
+ hooks:
18
+ - id: ruff-check
19
+ args: ['--fix', '--unsafe-fixes']
20
+ - id: ruff-format
21
+ - repo: https://opendev.org/openstack/hacking
22
+ rev: 8.0.0
23
+ hooks:
24
+ - id: hacking
25
+ additional_dependencies: []
@@ -9,12 +9,13 @@
9
9
  - release-notes-jobs-python3
10
10
  check:
11
11
  jobs:
12
- - openstack-tox-functional-py38
12
+ - openstack-tox-functional-py310
13
+ - openstack-tox-functional-py313
13
14
  - tempest-smoke-py3-osprofiler-redis
14
15
  - tempest-smoke-py3-osprofiler-sqlalchemy
15
16
  gate:
16
17
  jobs:
17
- - openstack-tox-functional-py38
18
+ - openstack-tox-functional-py310
18
19
 
19
20
  - job:
20
21
  name: tempest-smoke-py3-osprofiler-redis
@@ -17,8 +17,11 @@ Daniel Bengtsson <dbengt@redhat.com>
17
17
  Daria Kobtseva <daria.kts@gmail.com>
18
18
  Davanum Srinivas <davanum@gmail.com>
19
19
  Dina Belova <dbelova@mirantis.com>
20
+ Dirk Müller <dirk@dmllr.de>
21
+ Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
20
22
  Doug Hellmann <doug@doughellmann.com>
21
23
  Einst Crazy <yu.changcai@99cloud.net>
24
+ Eunkyung99 <ek121.kim@samsung.com>
22
25
  Flavio Percoco <flaper87@gmail.com>
23
26
  Ghanshyam Mann <gmann@ghanshyammann.com>
24
27
  Goutham Pacha Ravi <gouthampravi@gmail.com>
@@ -71,11 +74,13 @@ YuehuiLei <leiyuehui@inspur.com>
71
74
  Zhi Yan Liu <zhiyanl@cn.ibm.com>
72
75
  caoyuan <cao.yuan@99cloud.net>
73
76
  chenxu <424024687@qq.com>
77
+ chung00-lee <chung00.lee@samsung.com>
74
78
  francotseng <francotseng18@gmail.com>
75
79
  gecong1973 <ge.cong@zte.com.cn>
76
80
  howardlee <lihongweibj@inspur.com>
77
81
  kavithahr <kavitha.r@nectechnologies.in>
78
82
  lipan <lipan7195@fiberhome.com>
83
+ lkuchlan <lkuchlan@redhat.com>
79
84
  lvdongbing <dongbing.lv@kylin-cloud.com>
80
85
  melissaml <ma.lei@99cloud.net>
81
86
  niuke <niuke19970315@163.com>
@@ -1,6 +1,50 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ 4.4.0
5
+ -----
6
+
7
+ * tox: Use new constraints option
8
+ * Remove compatibility with SQLAlchemy<2.0
9
+ * Fix OSProfiler compatibility issues with SQLAlchemy 2.0 and Rally
10
+ * redis: Drop support for unused db parameter
11
+ * typing: Update for typed oslotest, debtcollector
12
+ * Create root span in the otlp driver
13
+ * Remove hacking checks about assertion methods
14
+ * Use built-in noqa check
15
+ * Remove old check for Python 2-3 compatibility
16
+ * Add typing
17
+ * Add ruff
18
+ * Replace deprecated datetime.datetime.utcnow
19
+ * Migrate upper functional job to Python 3.13
20
+ * Fix KeyError in notifying db errors
21
+ * Replace remaining py39 target
22
+ * Exclude tests directory from bandit check
23
+ * Replace own hacking checks by built-in ones
24
+ * Remove tox target for lower-constraints check
25
+ * pre-commit: Bump dependencies
26
+ * Migrate setup configuration to pyproject.toml
27
+ * Drop Python 3.9 support
28
+ * Cleanup jaeger backend from devstack and examples
29
+ * Retire Jaeger driver
30
+ * add pyproject.toml to support pip 23.1
31
+ * Explicitly add six to unblock unit tests
32
+
33
+ 4.3.0
34
+ -----
35
+
36
+ * tox: Remove basepython
37
+ * Run pyupgrade to clean up Python 2 syntaxes
38
+ * Update functional test environments
39
+ * Drop redundant if-else block
40
+ * pre-commit: Bump version
41
+ * Drop remaining pin of elasticsearch
42
+ * Remove Python 3.8 support
43
+ * Unpin for newer elasticsearch versions
44
+ * Replace deprecated constant\_time\_compare
45
+ * Bump hacking to latest
46
+ * Update bandit to 1.7.x
47
+
4
48
  4.2.0
5
49
  -----
6
50
 
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.4
2
+ Name: osprofiler
3
+ Version: 4.4.0
4
+ Summary: OpenStack Profiler Library
5
+ Author-email: OpenStack <openstack-discuss@lists.openstack.org>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://docs.openstack.org/osprofiler/
8
+ Project-URL: Repository, https://opendev.org/openstack/osprofiler
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/x-rst
22
+ License-File: LICENSE
23
+ Requires-Dist: netaddr>=0.7.18
24
+ Requires-Dist: oslo.concurrency>=3.26.0
25
+ Requires-Dist: oslo.config>=5.2.0
26
+ Requires-Dist: oslo.serialization>=2.18.0
27
+ Requires-Dist: oslo.utils>=3.33.0
28
+ Requires-Dist: PrettyTable>=0.7.2
29
+ Requires-Dist: requests>=2.14.2
30
+ Requires-Dist: WebOb>=1.7.1
31
+ Provides-Extra: elasticsearch
32
+ Requires-Dist: elasticsearch>=2.0.0; extra == "elasticsearch"
33
+ Provides-Extra: messaging
34
+ Requires-Dist: oslo.messaging>=14.1.0; extra == "messaging"
35
+ Provides-Extra: mongo
36
+ Requires-Dist: pymongo!=3.1,>=3.0.2; extra == "mongo"
37
+ Provides-Extra: otlp
38
+ Requires-Dist: opentelemetry-exporter-otlp>=1.16.0; extra == "otlp"
39
+ Requires-Dist: opentelemetry-sdk>=1.16.0; extra == "otlp"
40
+ Provides-Extra: redis
41
+ Requires-Dist: redis>=2.10.0; extra == "redis"
42
+ Provides-Extra: sqlalchemy
43
+ Requires-Dist: SQLAlchemy>=2.0.0; extra == "sqlalchemy"
44
+ Dynamic: license-file
45
+ Dynamic: requires-dist
46
+
47
+ ===================================================
48
+ OSProfiler -- Library for cross-project profiling
49
+ ===================================================
50
+
51
+ .. image:: https://governance.openstack.org/tc/badges/osprofiler.svg
52
+ :target: https://governance.openstack.org/tc/reference/tags/index.html
53
+
54
+ .. Change things from this point on
55
+
56
+ .. image:: https://img.shields.io/pypi/v/osprofiler.svg
57
+ :target: https://pypi.org/project/osprofiler/
58
+ :alt: Latest Version
59
+
60
+ .. image:: https://img.shields.io/pypi/dm/osprofiler.svg
61
+ :target: https://pypi.org/project/osprofiler/
62
+ :alt: Downloads
63
+
64
+ OSProfiler provides a tiny but powerful library that is used by
65
+ most (soon to be all) OpenStack projects and their python clients. It
66
+ provides functionality to be able to generate 1 trace per request, that goes
67
+ through all involved services. This trace can then be extracted and used
68
+ to build a tree of calls which can be quite handy for a variety of
69
+ reasons (for example in isolating cross-project performance issues).
70
+
71
+ * Free software: Apache license
72
+ * Documentation: https://docs.openstack.org/osprofiler/latest/
73
+ * Source: https://opendev.org/openstack/osprofiler
74
+ * Bugs: https://bugs.launchpad.net/osprofiler
75
+ * Release notes: https://docs.openstack.org/releasenotes/osprofiler
@@ -16,7 +16,7 @@ that control this:
16
16
 
17
17
  * ``<empty>`` - default messaging driver is used
18
18
  * ``redis`` - Redis is installed
19
- * ``jaeger`` - Jaeger is installed
19
+ * ``otlp`` - Jaeger is installed
20
20
  * ``sqlalchemy`` - SQLAlchemy driver is installed
21
21
 
22
22
  The default value of ``OSPROFILER_CONNECTION_STRING`` is set automatically
@@ -31,7 +31,7 @@ that control this:
31
31
  * ``elasticsearch://host:port`` - use Elasticsearch as trace storage
32
32
  * ``mongodb://host:port`` - use MongoDB as trace storage
33
33
  * ``loginsight://username:password@host`` - use LogInsight as trace collector/storage
34
- * ``jaeger://host:port`` - use Jaeger as trace collector
34
+ * ``otlp://host:port`` - use OTLP as trace collector
35
35
  * ``mysql+pymysql://username:password@host/profiler?charset=utf8`` - use SQLAlchemy driver with MySQL database
36
36
 
37
37
 
@@ -69,11 +69,6 @@ function install_jaeger_backend() {
69
69
  fi
70
70
  }
71
71
 
72
- function install_jaeger() {
73
- install_jaeger_backend
74
- pip_install jaeger-client
75
- }
76
-
77
72
  function install_otlp() {
78
73
  # For OTLP we use Jaeger backend but any OTLP compatible backend
79
74
  # can be used.
@@ -81,7 +76,7 @@ function install_otlp() {
81
76
  pip_install opentelemetry-sdk opentelemetry-exporter-otlp
82
77
  }
83
78
 
84
- function drop_jaeger() {
79
+ function drop_jaeger_backend() {
85
80
  sg docker -c 'docker rm jaeger --force'
86
81
  }
87
82
 
@@ -119,9 +114,6 @@ function install_osprofiler_collector() {
119
114
  elif [ "$OSPROFILER_COLLECTOR" == "redis" ]; then
120
115
  install_redis
121
116
  OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"redis://localhost:6379"}
122
- elif [ "$OSPROFILER_COLLECTOR" == "jaeger" ]; then
123
- install_jaeger
124
- OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"jaeger://localhost:6831"}
125
117
  elif [ "$OSPROFILER_COLLECTOR" == "otlp" ]; then
126
118
  install_otlp
127
119
  OSPROFILER_CONNECTION_STRING=${OSPROFILER_CONNECTION_STRING:-"otlp://localhost:4318"}
@@ -20,10 +20,9 @@ elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then
20
20
  configure_osprofiler_in_tempest
21
21
 
22
22
  elif [[ "$1" == "unstack" ]]; then
23
- if [[ "$OSPROFILER_COLLECTOR" == "jaeger" || \
24
- "$OSPROFILER_COLLECTOR" == "otlp" ]]; then
23
+ if [[ "$OSPROFILER_COLLECTOR" == "otlp" ]]; then
25
24
  echo_summary "Deleting jaeger docker container"
26
- drop_jaeger
25
+ drop_jaeger_backend
27
26
  fi
28
27
  fi
29
28
 
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  # Copyright (C) 2020 Red Hat, Inc.
3
2
  #
4
3
  # Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -32,9 +31,7 @@ import sys
32
31
  # directory, add these directories to sys.path here. If the directory
33
32
  # is relative to the documentation root, use os.path.abspath to make
34
33
  # it absolute, like shown here.
35
- sys.path.extend([
36
- os.path.abspath('../..'),
37
- ])
34
+ sys.path.extend([os.path.abspath('../..')])
38
35
 
39
36
 
40
37
  # -- General configuration ---------------------
@@ -99,7 +96,7 @@ html_theme = 'openstackdocs'
99
96
  html_static_path = []
100
97
 
101
98
  # Output file base name for HTML help builder.
102
- htmlhelp_basename = '%sdoc' % project
99
+ htmlhelp_basename = f'{project}doc'
103
100
 
104
101
  # -- Options for LaTeX output --------------
105
102
 
@@ -109,10 +106,13 @@ latex_elements = {}
109
106
  # (source start file, target name, title, author,
110
107
  # documentclass [howto/manual]).
111
108
  latex_documents = [
112
- ('index',
113
- '%s.tex' % project,
114
- '%s Documentation' % project,
115
- 'OpenStack Foundation', 'manual'),
109
+ (
110
+ 'index',
111
+ f'{project}.tex',
112
+ f'{project} Documentation',
113
+ 'OpenStack Foundation',
114
+ 'manual',
115
+ ),
116
116
  ]
117
117
 
118
118
  # -- Options for Texinfo output -----------
@@ -128,13 +128,13 @@ texinfo_documents = [
128
128
  'OSprofiler Team',
129
129
  'OSprofiler',
130
130
  'One line description of project.',
131
- 'Miscellaneous'
131
+ 'Miscellaneous',
132
132
  ),
133
133
  ]
134
134
 
135
135
  apidoc_output_dir = 'contributor/modules'
136
136
  apidoc_module_dir = '../../osprofiler'
137
137
  apidoc_excluded_paths = [
138
- 'hacking',
139
- 'tests',
138
+ 'hacking',
139
+ 'tests',
140
140
  ]
@@ -16,5 +16,5 @@ that are similar (in idea and ideal to OSprofiler).
16
16
  .. _Dapper: http://research.google.com/pubs/pub36356.html
17
17
  .. _Tomograph: https://github.com/stackforge/tomograph
18
18
  .. _HTrace: https://htrace.incubator.apache.org/
19
- .. _Jaeger: https://uber.github.io/jaeger/
19
+ .. _Jaeger: https://www.jaegertracing.io/
20
20
  .. _OpenTracing: https://opentracing.io/
@@ -19,12 +19,28 @@ import hmac
19
19
  import json
20
20
  import os
21
21
  import uuid
22
+ from collections.abc import Generator, Sequence
23
+ from typing import Any, TypeVar, overload
22
24
 
23
- from oslo_utils import secretutils
24
25
  from oslo_utils import uuidutils
25
26
 
27
+ _C = TypeVar("_C")
28
+ _T = TypeVar("_T")
26
29
 
27
- def split(text, strip=True):
30
+ _AlreadySplit = TypeVar('_AlreadySplit', bound=list[Any] | tuple[Any, ...])
31
+
32
+
33
+ @overload
34
+ def split(text: str, strip: bool = True) -> list[str]: ...
35
+
36
+
37
+ @overload
38
+ def split(text: _AlreadySplit, strip: bool = True) -> _AlreadySplit: ...
39
+
40
+
41
+ def split(
42
+ text: str | _AlreadySplit, strip: bool = True
43
+ ) -> list[str] | _AlreadySplit:
28
44
  """Splits a comma separated text blob into its components.
29
45
 
30
46
  Does nothing if already a list or tuple.
@@ -32,14 +48,14 @@ def split(text, strip=True):
32
48
  if isinstance(text, (tuple, list)):
33
49
  return text
34
50
  if not isinstance(text, str):
35
- raise TypeError("Unknown how to split '%s': %s" % (text, type(text)))
51
+ raise TypeError(f"Unknown how to split '{text}': {type(text)}")
36
52
  if strip:
37
53
  return [t.strip() for t in text.split(",") if t.strip()]
38
54
  else:
39
55
  return text.split(",")
40
56
 
41
57
 
42
- def binary_encode(text, encoding="utf-8"):
58
+ def binary_encode(text: bytes | str, encoding: str = "utf-8") -> bytes:
43
59
  """Converts a string of into a binary type using given encoding.
44
60
 
45
61
  Does nothing if text not unicode string.
@@ -52,7 +68,7 @@ def binary_encode(text, encoding="utf-8"):
52
68
  raise TypeError("Expected binary or string type")
53
69
 
54
70
 
55
- def binary_decode(data, encoding="utf-8"):
71
+ def binary_decode(data: bytes | str, encoding: str = "utf-8") -> str:
56
72
  """Converts a binary type into a text type using given encoding.
57
73
 
58
74
  Does nothing if data is already unicode string.
@@ -65,14 +81,16 @@ def binary_decode(data, encoding="utf-8"):
65
81
  raise TypeError("Expected binary or string type")
66
82
 
67
83
 
68
- def generate_hmac(data, hmac_key):
84
+ def generate_hmac(data: bytes | str, hmac_key: bytes | str) -> str:
69
85
  """Generate a hmac using a known key given the provided content."""
70
86
  h = hmac.new(binary_encode(hmac_key), digestmod=hashlib.sha1)
71
87
  h.update(binary_encode(data))
72
88
  return h.hexdigest()
73
89
 
74
90
 
75
- def signed_pack(data, hmac_key):
91
+ def signed_pack(
92
+ data: dict[str, str], hmac_key: str | None
93
+ ) -> tuple[bytes, str | None]:
76
94
  """Pack and sign data with hmac_key."""
77
95
  raw_data = base64.urlsafe_b64encode(binary_encode(json.dumps(data)))
78
96
 
@@ -83,7 +101,11 @@ def signed_pack(data, hmac_key):
83
101
  return raw_data, generate_hmac(raw_data, hmac_key) if hmac_key else None
84
102
 
85
103
 
86
- def signed_unpack(data, hmac_data, hmac_keys):
104
+ def signed_unpack(
105
+ data: str | bytes | None,
106
+ hmac_data: str | None,
107
+ hmac_keys: Sequence[str] | None,
108
+ ) -> dict[str, Any] | None:
87
109
  """Unpack data and check that it was signed with hmac_key.
88
110
 
89
111
  :param data: json string that was singed_packed.
@@ -96,7 +118,7 @@ def signed_unpack(data, hmac_data, hmac_keys):
96
118
  """
97
119
  # NOTE(boris-42): For security reason, if there is no hmac_data or
98
120
  # hmac_keys we don't trust data => return None.
99
- if not (hmac_keys and hmac_data):
121
+ if not hmac_keys or not hmac_data or not data:
100
122
  return None
101
123
  hmac_data = hmac_data.strip()
102
124
  if not hmac_data:
@@ -104,13 +126,14 @@ def signed_unpack(data, hmac_data, hmac_keys):
104
126
  for hmac_key in hmac_keys:
105
127
  try:
106
128
  user_hmac_data = generate_hmac(data, hmac_key)
107
- except Exception: # nosec
129
+ except Exception: # noqa: S110
108
130
  pass
109
131
  else:
110
- if secretutils.constant_time_compare(hmac_data, user_hmac_data):
132
+ if hmac.compare_digest(hmac_data, user_hmac_data):
111
133
  try:
112
- contents = json.loads(
113
- binary_decode(base64.urlsafe_b64decode(data)))
134
+ contents: dict[str, Any] = json.loads(
135
+ binary_decode(base64.urlsafe_b64decode(data))
136
+ )
114
137
  contents["hmac_key"] = hmac_key
115
138
  return contents
116
139
  except Exception:
@@ -118,14 +141,16 @@ def signed_unpack(data, hmac_data, hmac_keys):
118
141
  return None
119
142
 
120
143
 
121
- def itersubclasses(cls, _seen=None):
144
+ def itersubclasses(
145
+ cls: type[_C], _seen: set[type] | None = None
146
+ ) -> Generator[type[_C], None, None]:
122
147
  """Generator over all subclasses of a given class in depth first order."""
123
148
 
124
149
  _seen = _seen or set()
125
150
  try:
126
151
  subs = cls.__subclasses__()
127
- except TypeError: # fails only when cls is type
128
- subs = cls.__subclasses__(cls)
152
+ except TypeError: # fails only when cls is type
153
+ subs = cls.__subclasses__(cls) # type: ignore[call-arg]
129
154
  for sub in subs:
130
155
  if sub not in _seen:
131
156
  _seen.add(sub)
@@ -134,23 +159,23 @@ def itersubclasses(cls, _seen=None):
134
159
  yield sub
135
160
 
136
161
 
137
- def import_modules_from_package(package):
162
+ def import_modules_from_package(package: str) -> None:
138
163
  """Import modules from package and append into sys.modules
139
164
 
140
165
  :param: package - Full package name. For example: rally.deploy.engines
141
166
  """
142
- path = [os.path.dirname(__file__), ".."] + package.split(".")
143
- path = os.path.join(*path)
167
+ path_parts = [os.path.dirname(__file__), ".."] + package.split(".")
168
+ path = os.path.join(*path_parts)
144
169
  for root, dirs, files in os.walk(path):
145
170
  for filename in files:
146
171
  if filename.startswith("__") or not filename.endswith(".py"):
147
172
  continue
148
173
  new_package = ".".join(root.split(os.sep)).split("....")[1]
149
- module_name = "%s.%s" % (new_package, filename[:-3])
174
+ module_name = f"{new_package}.{filename[:-3]}"
150
175
  __import__(module_name)
151
176
 
152
177
 
153
- def shorten_id(span_id):
178
+ def shorten_id(span_id: str | int) -> int:
154
179
  """Convert from uuid4 to 64 bit id for OpenTracing"""
155
180
  int64_max = (1 << 64) - 1
156
181
  if isinstance(span_id, int):
@@ -163,7 +188,7 @@ def shorten_id(span_id):
163
188
  return short_id
164
189
 
165
190
 
166
- def uuid_to_int128(span_uuid):
191
+ def uuid_to_int128(span_uuid: str | int) -> int:
167
192
  """Convert from uuid4 to 128 bit id for OpenTracing"""
168
193
  if isinstance(span_uuid, int):
169
194
  return span_uuid
@@ -13,10 +13,12 @@
13
13
  # License for the specific language governing permissions and limitations
14
14
  # under the License.
15
15
 
16
+ from collections.abc import Callable
16
17
  import os
18
+ from typing import Any
17
19
 
18
20
 
19
- def env(*args, **kwargs):
21
+ def env(*args: str, **kwargs: str) -> str:
20
22
  """Returns the first environment variable set.
21
23
 
22
24
  If all are empty, defaults to '' or keyword arg `default`.
@@ -28,7 +30,9 @@ def env(*args, **kwargs):
28
30
  return kwargs.get("default", "")
29
31
 
30
32
 
31
- def arg(*args, **kwargs):
33
+ def arg(
34
+ *args: Any, **kwargs: Any
35
+ ) -> Callable[[Callable[..., Any]], Callable[..., Any]]:
32
36
  """Decorator for CLI args.
33
37
 
34
38
  Example:
@@ -37,21 +41,23 @@ def arg(*args, **kwargs):
37
41
  ... def entity_create(args):
38
42
  ... pass
39
43
  """
40
- def _decorator(func):
44
+
45
+ def _decorator(func: Callable[..., Any]) -> Callable[..., Any]:
41
46
  add_arg(func, *args, **kwargs)
42
47
  return func
48
+
43
49
  return _decorator
44
50
 
45
51
 
46
- def add_arg(func, *args, **kwargs):
52
+ def add_arg(func: Callable[..., Any], *args: Any, **kwargs: Any) -> None:
47
53
  """Bind CLI arguments to a shell.py `do_foo` function."""
48
54
 
49
55
  if not hasattr(func, "arguments"):
50
- func.arguments = []
56
+ setattr(func, "arguments", [])
51
57
 
52
58
  # NOTE(sirp): avoid dups that can occur when the module is shared across
53
59
  # tests.
54
- if (args, kwargs) not in func.arguments:
60
+ if (args, kwargs) not in getattr(func, "arguments"):
55
61
  # Because of the semantics of decorator composition if we just append
56
62
  # to the options list positional options will appear to be backwards.
57
- func.arguments.insert(0, (args, kwargs))
63
+ getattr(func, "arguments").insert(0, (args, kwargs))