././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.372503 oslo_metrics-0.12.1.dev1/0000775000175100017510000000000015033315273014245 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/.pre-commit-config.yaml0000664000175100017510000000211415033315272020523 0ustar00mylesmylesrepos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: trailing-whitespace # Replaces or checks mixed line ending - id: mixed-line-ending args: ['--fix', 'lf'] exclude: '.*\.(svg)$' # Forbid files which have a UTF-8 byte-order marker - id: check-byte-order-marker # Checks that non-binary executables have a proper shebang - id: check-executables-have-shebangs # Check for files that contain merge conflict strings. - id: check-merge-conflict # Check for debugger imports and py37+ breakpoint() # calls in python source - id: debug-statements - id: check-yaml files: .*\.(yaml|yml)$ - repo: https://opendev.org/openstack/hacking rev: 7.0.0 hooks: - id: hacking additional_dependencies: [] - repo: https://github.com/PyCQA/bandit rev: 1.7.10 hooks: - id: bandit args: ['-x', 'tests'] - repo: https://github.com/asottile/pyupgrade rev: v3.18.0 hooks: - id: pyupgrade args: [--py3-only] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/.stestr.conf0000664000175100017510000000006515033315272016516 0ustar00mylesmyles[DEFAULT] test_path=./oslo_metrics/tests top_path=./ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/.zuul.yaml0000664000175100017510000000033315033315272016204 0ustar00mylesmyles- project: templates: - check-requirements - lib-forward-testing-python3 - openstack-python3-jobs - periodic-stable-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/AUTHORS0000664000175100017510000000130115033315273015310 0ustar00mylesmylesArnaud Morin Artem Vasilyev Ching Kuo Ching Kuo Corey Bryant Gabin Lanore Ghanshyam Ghanshyam Mann Guillaume Espanel Hervé Beraud Masahito Muroi OpenStack Release Bot Takashi Kajinami Thierry Carrez maaoyu songwenping wangzihao zhangboye ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/CONTRIBUTING.rst0000664000175100017510000000104115033315272016701 0ustar00mylesmylesIf you would like to contribute to the development of OpenStack, you must follow the steps in this page: https://docs.openstack.org/infra/manual/developers.html Once those steps have been completed, changes to OpenStack should be submitted for review via the Gerrit tool, following the workflow documented at: https://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: https://bugs.launchpad.net/oslo.metrics ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/ChangeLog0000664000175100017510000000512215033315273016017 0ustar00mylesmylesCHANGES ======= * add pyproject.toml to support pip 23.1 0.12.0 ------ * tox: Remove basepython * Update master for stable/2025.1 * feat: add option to set chmod to socket 0.11.0 ------ * Skip installation to speed up pep8 * Restore group permissions to unix socket file * Run pyupgrade to clean up Python 2 syntaxes * Introduce pre-commit 0.10.1 ------ * reno: Update master for unmaintained/2023.1 * Set log level to debug when dispatching metrics 0.10.0 ------ * Add note about requirements lower bounds * Remove Python 3.8 support * Drop unnecessary 'x' bit from doc config file * Use PortOpt for prometheus\_port * Declare Python 3.12 support * Update master for stable/2024.2 0.9.0 ----- * reno: Update master for unmaintained/zed * Remove old excludes * Update master for stable/2024.1 * reno: Update master for unmaintained/xena * reno: Update master for unmaintained/wallaby 0.8.0 ----- * reno: Update master for unmaintained/yoga * Bump hacking * Update python classifier in setup.cfg * Update master for stable/2023.2 0.7.0 ----- * Bump bandit and make oslo.metrics compatible with latest rules * Revert "Moves supported python runtimes from version 3.8 to 3.10" * Moves supported python runtimes from version 3.8 to 3.10 * Update master for stable/2023.1 0.6.0 ----- * Fix logging labales --> labels * Add Python3 antelope unit tests * Update master for stable/zed 0.5.0 ----- * Drop python3.6/3.7 support in testing runtime * Remove unnecessary unicode prefixes * Update master for stable/yoga 0.4.0 ----- * Limit metrics\_socket\_file permissions * Update master for stable/xena * Changed minversion in tox to 3.18.0 0.3.0 ----- * setup.cfg: Replace dashes with underscores * Enable Test Coverage and Add New Test * Fix Heading Characters * Enable bandit * Make Expose Port Configurable * Add Devstack Installation Guide * Use py3 as the default runtime for tox * Dropping lower constraints testing * Update master for stable/wallaby 0.2.1 ----- * Add timeout, method to RPC Client Label 0.2.0 ----- * Update Metric Naming * Handle Sigterm Properly 0.1.0 ----- * Improve Socket for oslo.metrics * bump py37 to py38 in tox.ini * Add basic tests for message processing * Add a basic test framework for oslo.metrics * Configure zuul * add lower-constraints * fix pep8 issues * Add releasenotes * Add project documentation * Setup base test environment * Add an entrypoints to launch oslo.metrics * Add a couple of gitignore rules * Sample oslo.metrics codes * Trivial change to test replication * Add date for expected initial code drop * Base content, waiting for initial code drop * Added .gitreview ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/LICENSE0000664000175100017510000002363715033315272015264 0ustar00mylesmyles Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.372503 oslo_metrics-0.12.1.dev1/PKG-INFO0000644000175100017510000000265615033315273015351 0ustar00mylesmylesMetadata-Version: 2.2 Name: oslo.metrics Version: 0.12.1.dev1 Summary: Oslo Metrics API Home-page: https://opendev.org/openstack/oslo.metrics Author: OpenStack Author-email: openstack-discuss@lists.openstack.org Classifier: Environment :: OpenStack Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Information Technology Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Requires-Python: >=3.9 License-File: LICENSE Requires-Dist: pbr>=3.1.1 Requires-Dist: oslo.utils>=3.41.0 Requires-Dist: oslo.log>=3.44.0 Requires-Dist: oslo.config>=6.9.0 Requires-Dist: prometheus-client>=0.6.0 Dynamic: author Dynamic: author-email Dynamic: classifier Dynamic: description Dynamic: home-page Dynamic: requires-dist Dynamic: requires-python Dynamic: summary ==================== Oslo Metrics Library ==================== This Oslo metrics API supports collecting metrics data from other Oslo libraries and exposing the metrics data to monitoring system. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/README.rst0000664000175100017510000000030515033315272015731 0ustar00mylesmyles==================== Oslo Metrics Library ==================== This Oslo metrics API supports collecting metrics data from other Oslo libraries and exposing the metrics data to monitoring system. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/RELEASENOTES.rst0000664000175100017510000000236215033315273016673 0ustar00mylesmyles============ oslo.metrics ============ .. _oslo.metrics_0.12.0: 0.12.0 ====== .. _oslo.metrics_0.12.0_New Features: New Features ------------ .. releasenotes/notes/socket-permission-4081813647fcc8ac.yaml @ b'be7067daec2e012f95d4bdf009d7d02906c30af8' - Introduced a new configuration option ``metrics_socket_perm`` under the ``oslo_metrics`` group, allowing users to set custom permissions for the Unix domain socket file. .. _oslo.metrics_0.1.0: 0.1.0 ===== .. _oslo.metrics_0.1.0_Other Notes: Other Notes ----------- .. releasenotes/notes/add-reno-0cc4d7566599aebd.yaml @ b'760b1a06a181a0eeea2007eb41eecfbba85dbf05' - Add reno for managing release notes. .. _oslo.metrics_0.4.0: 0.4.0 ===== .. _oslo.metrics_0.4.0_New Features: New Features ------------ .. releasenotes/notes/port-config-ac5d9ee247a8ff9b.yaml @ b'6ad0f5db2c12591399555b17ab2510b6b21eb658' - Port number to expose metrics in Prometheus format is now configurable. .. _oslo.metrics_0.10.0: 0.10.0 ====== .. _oslo.metrics_0.10.0_Upgrade Notes: Upgrade Notes ------------- .. releasenotes/notes/remove-py38-16eda9eaf9fe00d0.yaml @ b'4bf5fb6906392757efa7f51bce91d5c601f394f7' - Support for Python 3.8 has been removed. Now the minimum python version supported is 3.9 . ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.371503 oslo_metrics-0.12.1.dev1/doc/0000775000175100017510000000000015033315273015012 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/doc/requirements.txt0000664000175100017510000000032115033315272020271 0ustar00mylesmyles# For generating sphinx documentation openstackdocstheme>=1.18.1 # Apache-2.0 sphinx>=1.8.0 # BSD reno>=2.5.0 # Apache-2.0 sphinxcontrib-apidoc>=0.2.0 # BSD # For autodoc builds oslotest>=3.2.0 # Apache-2.0 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.371503 oslo_metrics-0.12.1.dev1/doc/source/0000775000175100017510000000000015033315273016312 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/doc/source/conf.py0000664000175100017510000000525615033315272017620 0ustar00mylesmyles# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinxcontrib.apidoc', 'sphinx.ext.intersphinx', 'openstackdocstheme', 'oslo_config.sphinxext', ] # openstackdocstheme options openstackdocs_repo_name = 'openstack/oslo.metrics' openstackdocs_bug_project = 'oslo.metrics' openstackdocs_bug_tag = '' # sphinxcontrib.apidoc options apidoc_module_dir = '../../oslo_metrics' apidoc_output_dir = 'reference/api' apidoc_excluded_paths = [ 'tests' ] # The suffix of source filenames. source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = 'oslo.metrics' copyright = '2014, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). add_module_names = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['oslo_metrics.'] # -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] html_theme = 'openstackdocs' # html_static_path = ['static'] # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ ('index', '%s.tex' % project, '%s Documentation' % project, 'OpenStack Foundation', 'manual'), ] intersphinx_mapping = { 'python': ('https://docs.python.org/', None), 'osloconfig': ('http://docs.openstack.org/oslo.config/latest/', None), } ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.371503 oslo_metrics-0.12.1.dev1/doc/source/contributor/0000775000175100017510000000000015033315273020664 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/doc/source/contributor/index.rst0000664000175100017510000000011715033315272022523 0ustar00mylesmyles============ Contributing ============ .. include:: ../../../CONTRIBUTING.rst ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/doc/source/index.rst0000664000175100017510000000101615033315272020150 0ustar00mylesmyles============ oslo.metrics ============ This Oslo metrics API supports collecting metrics data from other Oslo libraries and exposing the metrics data to monitoring system. Contents ======== .. toctree:: :maxdepth: 2 install/index contributor/index reference/api/modules user/index Release Notes ============= Read also the `oslo.metrics Release Notes `_. Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.371503 oslo_metrics-0.12.1.dev1/doc/source/install/0000775000175100017510000000000015033315273017760 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/doc/source/install/index.rst0000664000175100017510000000013615033315272021620 0ustar00mylesmyles============ Installation ============ At the command line:: $ pip install oslo.metrics ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.371503 oslo_metrics-0.12.1.dev1/doc/source/user/0000775000175100017510000000000015033315273017270 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/doc/source/user/history.rst0000664000175100017510000000004015033315272021514 0ustar00mylesmyles.. include:: ../../../ChangeLog ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/doc/source/user/index.rst0000664000175100017510000000021315033315272021124 0ustar00mylesmyles================== Using oslo.metrics ================== .. toctree:: :maxdepth: 2 usage .. toctree:: :maxdepth: 1 history ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/doc/source/user/usage.rst0000664000175100017510000000664115033315272021134 0ustar00mylesmyles===== Usage ===== A simple example of oslo.metrics in use:: $ oslo-metrics 2020-06-11 15:59:53.459 5435 INFO oslo.metrics.__main__ [-] Start oslo.metrics Testing with DevStack --------------------- This section describes how to test out oslo.metrics and collect oslo.messaging metric data using Devstack. Download DevStack ~~~~~~~~~~~~~~~~~ .. code-block:: console $ git clone https://opendev.org/openstack/devstack $ cd devstack The ``devstack`` repo contains a script that installs OpenStack and templates for configuration files. Create a local.conf ~~~~~~~~~~~~~~~~~~~ Create a ``local.conf`` file with four passwords preset at the root of the devstack git repo. .. code-block:: ini [[local|localrc]] ADMIN_PASSWORD=secret DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD LIBS_FROM_GIT=oslo.messaging [[post-config|$NOVA_CONF]] [oslo_messaging_metrics] metrics_enabled = True This is the minimum required config to get started with Devstack including oslo.metrics. Start the install ~~~~~~~~~~~~~~~~~ .. code-block:: console $ ./stack.sh This will take a 15 - 20 minutes, largely depending on the speed of your internet connection. Many git trees and packages will be installed during this process. Start the Metrics Server ~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: console $ oslo-metrics This command will start oslo.metrics server and start collecting oslo.messaging metrics sending from OpenStack services. oslo.metrics exporter will serve on port 3000 by default. Example Output ~~~~~~~~~~~~~~ An example of oslo.metrics collecting metrics from Nova: .. code-block:: console ubuntu@devstack:~/devstack$ oslo-metrics 2021-06-12 14:32:26.091 466289 INFO oslo.metrics.__main__ [-] Start oslo.metrics 2021-06-12 14:57:50.632 466289 DEBUG oslo.metrics.__main__ [-] wait for socket.recv serve /usr/local/lib/python3.8/dist-packages/oslo_metrics/__main__.py:73 2021-06-12 14:57:50.632 466289 DEBUG oslo.metrics.__main__ [-] got message serve /usr/local/lib/python3.8/dist-packages/oslo_metrics/__main__.py:76 2021-06-12 14:57:50.633 466289 INFO oslo.metrics.message_router [-] Get labels with rpc_client_processing_seconds: {'call_type': 'call', 'exchange': None, 'topic': 'conductor', 'namespace': 'baseapi', 'version': '1.0', 'server': None, 'fanout': None, 'method': 'ping', 'timeout': None, 'process': ''} 2021-06-12 14:57:50.633 466289 INFO oslo.metrics.message_router [-] Perform action observe for rpc_client_processing_seconds metrics 2021-06-12 14:57:50.633 466289 DEBUG oslo.metrics.__main__ [-] wait for socket.recv serve /usr/local/lib/python3.8/dist-packages/oslo_metrics/__main__.py:73 2021-06-12 14:57:50.633 466289 DEBUG oslo.metrics.__main__ [-] got message serve /usr/local/lib/python3.8/dist-packages/oslo_metrics/__main__.py:76 2021-06-12 14:57:50.633 466289 INFO oslo.metrics.message_router [-] Get labels with rpc_client_invocation_end_total: {'call_type': 'call', 'exchange': None, 'topic': 'conductor', 'namespace': 'baseapi', 'version': '1.0', 'server': None, 'fanout': None, 'method': 'ping', 'timeout': None, 'process': ''} 2021-06-12 14:57:50.633 466289 INFO oslo.metrics.message_router [-] Perform action inc for rpc_client_invocation_end_total metrics` Gathering Metrics ~~~~~~~~~~~~~~~~~ To gather metrics from oslo.metrics, configure Prometheus to scrape from port 3000 where oslo.metrics is running. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.371503 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/0000775000175100017510000000000015033315273020360 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/PKG-INFO0000644000175100017510000000265615033315273021464 0ustar00mylesmylesMetadata-Version: 2.2 Name: oslo.metrics Version: 0.12.1.dev1 Summary: Oslo Metrics API Home-page: https://opendev.org/openstack/oslo.metrics Author: OpenStack Author-email: openstack-discuss@lists.openstack.org Classifier: Environment :: OpenStack Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Information Technology Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Requires-Python: >=3.9 License-File: LICENSE Requires-Dist: pbr>=3.1.1 Requires-Dist: oslo.utils>=3.41.0 Requires-Dist: oslo.log>=3.44.0 Requires-Dist: oslo.config>=6.9.0 Requires-Dist: prometheus-client>=0.6.0 Dynamic: author Dynamic: author-email Dynamic: classifier Dynamic: description Dynamic: home-page Dynamic: requires-dist Dynamic: requires-python Dynamic: summary ==================== Oslo Metrics Library ==================== This Oslo metrics API supports collecting metrics data from other Oslo libraries and exposing the metrics data to monitoring system. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/SOURCES.txt0000664000175100017510000000314515033315273022247 0ustar00mylesmyles.pre-commit-config.yaml .stestr.conf .zuul.yaml AUTHORS CONTRIBUTING.rst ChangeLog LICENSE README.rst pyproject.toml requirements.txt setup.cfg setup.py test-requirements.txt tox.ini doc/requirements.txt doc/source/conf.py doc/source/index.rst doc/source/contributor/index.rst doc/source/install/index.rst doc/source/user/history.rst doc/source/user/index.rst doc/source/user/usage.rst oslo.metrics.egg-info/PKG-INFO oslo.metrics.egg-info/SOURCES.txt oslo.metrics.egg-info/dependency_links.txt oslo.metrics.egg-info/entry_points.txt oslo.metrics.egg-info/not-zip-safe oslo.metrics.egg-info/pbr.json oslo.metrics.egg-info/requires.txt oslo.metrics.egg-info/top_level.txt oslo_metrics/__init__.py oslo_metrics/__main__.py oslo_metrics/message_router.py oslo_metrics/message_type.py oslo_metrics/metrics/__init__.py oslo_metrics/metrics/oslo_messaging.py oslo_metrics/tests/__init__.py oslo_metrics/tests/test_message_process.py oslo_metrics/tests/test_message_validation.py releasenotes/notes/add-reno-0cc4d7566599aebd.yaml releasenotes/notes/port-config-ac5d9ee247a8ff9b.yaml releasenotes/notes/remove-py38-16eda9eaf9fe00d0.yaml releasenotes/notes/socket-permission-4081813647fcc8ac.yaml releasenotes/source/2023.1.rst releasenotes/source/2023.2.rst releasenotes/source/2024.1.rst releasenotes/source/2024.2.rst releasenotes/source/2025.1.rst releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/unreleased.rst releasenotes/source/wallaby.rst releasenotes/source/xena.rst releasenotes/source/yoga.rst releasenotes/source/zed.rst releasenotes/source/_static/.placeholder releasenotes/source/_templates/.placeholder././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/dependency_links.txt0000664000175100017510000000000115033315273024426 0ustar00mylesmyles ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/entry_points.txt0000664000175100017510000000007415033315273023657 0ustar00mylesmyles[console_scripts] oslo-metrics = oslo_metrics.__main__:main ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/not-zip-safe0000664000175100017510000000000115033315273022606 0ustar00mylesmyles ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/pbr.json0000664000175100017510000000005715033315273022040 0ustar00mylesmyles{"git_version": "276d34d", "is_release": false}././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/requires.txt0000664000175100017510000000013315033315273022755 0ustar00mylesmylespbr>=3.1.1 oslo.utils>=3.41.0 oslo.log>=3.44.0 oslo.config>=6.9.0 prometheus-client>=0.6.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/oslo.metrics.egg-info/top_level.txt0000664000175100017510000000001515033315273023106 0ustar00mylesmylesoslo_metrics ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.371503 oslo_metrics-0.12.1.dev1/oslo_metrics/0000775000175100017510000000000015033315273016747 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/__init__.py0000664000175100017510000000000015033315272021045 0ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/__main__.py0000664000175100017510000000726415033315272021051 0ustar00mylesmyles# Copyright 2020 LINE Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os import select import signal import socket import sys import threading from wsgiref.simple_server import make_server from oslo_config import cfg from oslo_log import log as logging from prometheus_client import make_wsgi_app from oslo_metrics import message_router oslo_metrics_configs = [ cfg.StrOpt('metrics_socket_file', default='/var/tmp/metrics_collector.sock', # nosec help='Unix domain socket file to be used' ' to send rpc related metrics'), cfg.PortOpt('prometheus_port', default=3000, help='Port number to expose metrics in prometheus format.'), cfg.IntOpt('metrics_socket_perm', default=0o660, help='Permission set to the unix domain socket file'), ] cfg.CONF.register_opts(oslo_metrics_configs, group='oslo_metrics') LOG = logging.getLogger(__name__) CONF = cfg.CONF logging.register_options(CONF) logging.setup(CONF, 'oslo-metrics') class MetricsListener(): def __init__(self, socket_path): self.socket_path = socket_path self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) self.unlink(socket_path) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.bind(self.socket_path) self.start = True self.router = message_router.MessageRouter() def unlink(self, socket_path): try: os.unlink(socket_path) except OSError: if os.path.exists(socket_path): raise def serve(self): while self.start: readable, writable, exceptional = select.select( [self.socket], [], [], 1) if len(readable) == 0: continue try: LOG.debug("wait for socket.recv") # 1 message size should be smaller than 65565 msg = self.socket.recv(65565) LOG.debug("got message") self.router.process(msg) except socket.timeout: pass def stop(self): self.socket.close() self.start = False httpd = None def handle_sigterm(_signum, _frame): LOG.debug("Caught sigterm") shutdown_thread = threading.Thread(target=httpd.shutdown) shutdown_thread.start() def main(): cfg.CONF(sys.argv[1:]) socket_path = cfg.CONF.oslo_metrics.metrics_socket_file m = MetricsListener(socket_path) try: os.chmod(socket_path, cfg.CONF.oslo_metrics.metrics_socket_perm) except OSError: LOG.error("Changing the mode of the file failed.... continuing") mt = threading.Thread(target=m.serve) LOG.info("Start oslo.metrics") mt.start() app = make_wsgi_app() try: global httpd httpd = make_server('', CONF.oslo_metrics.prometheus_port, app) signal.signal(signal.SIGTERM, handle_sigterm) httpd.serve_forever() except KeyboardInterrupt: pass finally: LOG.info("Try to stop...") os.remove(cfg.CONF.oslo_metrics.metrics_socket_file) m.stop() httpd.server_close() if __name__ == "__main__": main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/message_router.py0000664000175100017510000000532615033315272022352 0ustar00mylesmyles# Copyright 2020 LINE Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_log import log as logging from oslo_utils import importutils from oslo_metrics import message_type LOG = logging.getLogger(__name__) MODULE_LISTS = [ "oslo_metrics.metrics.oslo_messaging", ] class MessageRouter(): def __init__(self): self.modules = {} for m_str in MODULE_LISTS: mod = importutils.try_import(m_str, False) if not mod: LOG.error("Failed to load module %s" % m_str) self.modules[m_str.split('.')[-1]] = mod def process(self, raw_string): try: metric = message_type.Metric.from_json(raw_string.decode()) self.dispatch(metric) except Exception as e: LOG.error("Failed to parse: %s", e) def dispatch(self, metric): if metric.module not in self.modules: LOG.error("Failed to lookup modules by %s" % metric.module) return mod = self.modules.get(metric.module) # Get metric try: metric_definition = getattr(mod, metric.name) except AttributeError as e: LOG.error("Failed to load metrics {}: {}".format(metric.name, e)) return # Get labels try: metric_with_label = getattr(metric_definition, "labels") metric_with_label = metric_with_label(**metric.labels) except AttributeError as e: LOG.error("Failed to load labels func from metrics %s: %s" % (metric.name, e)) return LOG.debug("Get labels with {}: {}".format(metric.name, metric.labels)) # perform action try: embed_action = getattr(metric_with_label, metric.action.action) if metric.action.value is not None: embed_action(metric.action.value) else: embed_action() except AttributeError as e: LOG.error("Failed to perform metric actionv %s, %s: %s" % (metric.action.action, metric.action.value, e)) return LOG.debug("Perform action %s for %s metrics" % (metric.action.action, metric.name)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/message_type.py0000664000175100017510000000606715033315272022016 0ustar00mylesmyles# Copyright 2020 LINE Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import json class UnSupportedMetricActionError(Exception): def __init__(self, message=None): self.message = message class MetricValidationError(Exception): def __init__(self, message=None): self.message = message class MetricAction(): actions = ['inc', 'observe'] def __init__(self, action, value): if action not in self.actions: raise UnSupportedMetricActionError( "%s action is not supported" % action) self.action = action self.value = value @classmethod def validate(cls, metric_action_dict): if "value" not in metric_action_dict: raise MetricValidationError("action need 'value' field") if "action" not in metric_action_dict: raise MetricValidationError("action need 'action' field") if metric_action_dict["action"] not in cls.actions: raise MetricValidationError( "action should be choosen from %s" % cls.actions) @classmethod def from_dict(cls, metric_action_dict): return cls( metric_action_dict["action"], metric_action_dict["value"] ) class Metric(): def __init__(self, module, name, action, **labels): self.module = module self.name = name self.action = action self.labels = labels def to_json(self): raw = { "module": self.module, "name": self.name, "action": { "value": self.action.value, "action": self.action.action }, "labels": self.labels } return json.dumps(raw) @classmethod def from_json(cls, encoded): metric_dict = json.loads(encoded) cls._validate(metric_dict) return Metric( metric_dict["module"], metric_dict["name"], MetricAction.from_dict(metric_dict["action"]), **metric_dict["labels"]) @classmethod def _validate(cls, metric_dict): if "module" not in metric_dict: raise MetricValidationError("module should be specified") if "name" not in metric_dict: raise MetricValidationError("name should be specified") if "action" not in metric_dict: raise MetricValidationError("action should be specified") if "labels" not in metric_dict: raise MetricValidationError("labels should be specified") MetricAction.validate(metric_dict["action"]) ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.371503 oslo_metrics-0.12.1.dev1/oslo_metrics/metrics/0000775000175100017510000000000015033315273020415 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/metrics/__init__.py0000664000175100017510000000000015033315272022513 0ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/metrics/oslo_messaging.py0000664000175100017510000000534715033315272024010 0ustar00mylesmyles# Copyright 2020 LINE Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import prometheus_client rpc_server_common_labels = [ 'exchange', 'topic', 'server', 'endpoint', 'namespace', 'version', 'method', 'process' ] rpc_client_common_labels = [ 'call_type', 'exchange', 'topic', 'namespace', 'version', 'server', 'fanout', 'process', 'method', 'timeout' ] rpc_processing_seconds_buckets = [ 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, 25.0, 50.0, 75.0, 100 ] # RPC Server Metrics rpc_server_invocation_start_total = prometheus_client.Counter( 'oslo_messaging_rpc_server_invocation_start_total', 'Total number of RPC invocation start. This doesn\'t count' 'if rpc server failed to find method from endpoints.', rpc_server_common_labels) rpc_server_invocation_end_total = prometheus_client.Counter( 'oslo_messaging_rpc_server_invocation_end_total', 'Total number of RPC invocation end.', rpc_server_common_labels) rpc_server_processing_seconds = prometheus_client.Histogram( 'oslo_messaging_rpc_server_processing_seconds', 'Duration of RPC processing.', rpc_server_common_labels, buckets=rpc_processing_seconds_buckets) rpc_server_exception_total = prometheus_client.Counter( 'oslo_messaging_rpc_server_exception_total', 'Total number of exception while RPC processing.', rpc_server_common_labels + ['exception']) # RPC Client Metrics rpc_client_invocation_start_total = prometheus_client.Counter( 'oslo_messaging_rpc_client_invocation_start_total', 'Total number of RPC invocation start.', rpc_client_common_labels) rpc_client_invocation_end_total = prometheus_client.Counter( 'oslo_messaging_rpc_client_invocation_end_total', 'Total number of RPC invocation end.', rpc_client_common_labels) rpc_client_processing_seconds = prometheus_client.Histogram( 'oslo_messaging_rpc_client_processing_seconds', 'Duration of RPC processing.', rpc_client_common_labels, buckets=rpc_processing_seconds_buckets) rpc_client_exception_total = prometheus_client.Counter( 'oslo_messaging_rpc_client_exception_total', 'Total number of exception while RPC processing.', rpc_client_common_labels + ['exception', ]) ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.372503 oslo_metrics-0.12.1.dev1/oslo_metrics/tests/0000775000175100017510000000000015033315273020111 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/tests/__init__.py0000664000175100017510000000000015033315272022207 0ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/tests/test_message_process.py0000664000175100017510000000423115033315272024703 0ustar00mylesmyles# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ test_message_process -------------------- Check that messages are processed correctly """ from unittest import mock from oslo_metrics import message_router from oslotest import base import prometheus_client class TestProcessMessage(base.BaseTestCase): def setUp(self): super().setUp() def test_process_counter(self): received_json = b"""{ "module": "oslo_messaging", "name": "rpc_server_invocation_start_total", "action": { "action": "inc", "value": null }, "labels": { "exchange": "foo", "topic": "bar", "server": "foobar", "endpoint": "endpoint", "namespace": "ns", "version": "v2", "method": "get", "process": "done" } }""" with mock.patch.object( prometheus_client.Counter, 'inc', ) as mock_inc: router = message_router.MessageRouter() router.process(received_json) mock_inc.assert_called_once_with() def test_process_histogram(self): received_json = b"""{ "module": "oslo_messaging", "name": "rpc_client_processing_seconds", "action": { "action": "observe", "value": 1.26 }, "labels": { "call_type": "call", "exchange": "foo", "topic": "bar", "method": "get", "server": "foobar", "namespace": "ns", "version": "v2", "process": "done", "fanout": "foo", "timeout": 10 } }""" with mock.patch.object( prometheus_client.Histogram, 'observe', ) as mock_inc: router = message_router.MessageRouter() router.process(received_json) mock_inc.assert_called_once_with(1.26) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/oslo_metrics/tests/test_message_validation.py0000664000175100017510000000464015033315272025363 0ustar00mylesmyles# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ test_message_validation -------------------- Check that messages validation is working properly """ import json from oslo_metrics import message_type from oslotest import base class TestMetricValidation(base.BaseTestCase): def setUp(self): super().setUp() def assertRaisesWithMessage(self, message, func, *args, **kwargs): try: func(*args, **kwargs) self.assertFail() except Exception as e: self.assertEqual(message, e.message) def test_message_validation(self): metric = dict() message = "module should be specified" self.assertRaisesWithMessage( message, message_type.Metric.from_json, json.dumps(metric)) metric['module'] = "test" message = "name should be specified" self.assertRaisesWithMessage( message, message_type.Metric.from_json, json.dumps(metric)) metric['name'] = "test" message = "action should be specified" self.assertRaisesWithMessage( message, message_type.Metric.from_json, json.dumps(metric)) metric['action'] = "test" message = "labels should be specified" self.assertRaisesWithMessage( message, message_type.Metric.from_json, json.dumps(metric)) metric['labels'] = "test_label" message = "action need 'value' field" self.assertRaisesWithMessage( message, message_type.Metric.from_json, json.dumps(metric)) metric['action'] = {"value": "1"} message = "action need 'action' field" self.assertRaisesWithMessage( message, message_type.Metric.from_json, json.dumps(metric)) metric['action']['action'] = "test" message = "action should be choosen from ['inc', 'observe']" self.assertRaisesWithMessage( message, message_type.Metric.from_json, json.dumps(metric)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/pyproject.toml0000664000175100017510000000010515033315272017154 0ustar00mylesmyles[build-system] requires = ["pbr>=6.1.1"] build-backend = "pbr.build" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1752013499.3705032 oslo_metrics-0.12.1.dev1/releasenotes/0000775000175100017510000000000015033315273016736 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.372503 oslo_metrics-0.12.1.dev1/releasenotes/notes/0000775000175100017510000000000015033315273020066 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/notes/add-reno-0cc4d7566599aebd.yaml0000664000175100017510000000007215033315272024747 0ustar00mylesmyles--- other: - | Add reno for managing release notes. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/notes/port-config-ac5d9ee247a8ff9b.yaml0000664000175100017510000000014015033315272025645 0ustar00mylesmyles--- features: - | Port number to expose metrics in Prometheus format is now configurable. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/notes/remove-py38-16eda9eaf9fe00d0.yaml0000664000175100017510000000016615033315272025505 0ustar00mylesmyles--- upgrade: - | Support for Python 3.8 has been removed. Now the minimum python version supported is 3.9 . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013499.0 oslo_metrics-0.12.1.dev1/releasenotes/notes/reno.cache0000664000175100017510000000447715033315273022032 0ustar00mylesmyles--- dates: - date: 1740146213 version: 0.11.0 - date: 1612791391 version: 0.2.0 - date: 1708615793 version: 0.8.0 - date: 1709821302 version: wallaby-eom - date: 1607446332 version: 0.1.0 - date: 1693227305 version: 0.7.0 - date: 1746177480 version: 2023.2-eol - date: 1732015650 version: 0.10.0 - date: 1667590751 version: wallaby-em - date: 1644229272 version: 0.3.1 - date: 1707229703 version: yoga-eom - date: 1737123962 version: 0.10.1 - date: 1724253214 version: 0.9.0 - date: 1661948061 version: 0.5.0 - date: 1732213806 version: 2023.1-eom - date: 1685632755 version: 0.5.1 - date: 1709821561 version: xena-eom - date: 1676044869 version: 0.6.0 - date: 1645542670 version: 0.2.2 - date: 1681994594 version: xena-em - date: 1747401593 version: 0.12.0 - date: 1634808655 version: 0.4.0 - date: 1613042951 version: 0.2.1 - date: 1629376434 version: 0.3.0 - date: 1714974984 version: zed-eom file-contents: releasenotes/notes/add-reno-0cc4d7566599aebd.yaml: other: - 'Add reno for managing release notes. ' releasenotes/notes/port-config-ac5d9ee247a8ff9b.yaml: features: - 'Port number to expose metrics in Prometheus format is now configurable. ' releasenotes/notes/remove-py38-16eda9eaf9fe00d0.yaml: upgrade: - 'Support for Python 3.8 has been removed. Now the minimum python version supported is 3.9 . ' releasenotes/notes/socket-permission-4081813647fcc8ac.yaml: features: - 'Introduced a new configuration option ``metrics_socket_perm`` under the ``oslo_metrics`` group, allowing users to set custom permissions for the Unix domain socket file. ' notes: - files: - - releasenotes/notes/socket-permission-4081813647fcc8ac.yaml - !!binary | YmU3MDY3ZGFlYzJlMDEyZjk1ZDRiZGYwMDlkN2QwMjkwNmMzMGFmOA== version: 0.12.0 - files: - - releasenotes/notes/add-reno-0cc4d7566599aebd.yaml - !!binary | NzYwYjFhMDZhMTgxYTBlZWVhMjAwN2ViNDFlZWNmYmJhODVkYmYwNQ== version: 0.1.0 - files: - - releasenotes/notes/port-config-ac5d9ee247a8ff9b.yaml - !!binary | NmFkMGY1ZGIyYzEyNTkxMzk5NTU1YjE3YWIyNTEwYjZiMjFlYjY1OA== version: 0.4.0 - files: - - releasenotes/notes/remove-py38-16eda9eaf9fe00d0.yaml - !!binary | NGJmNWZiNjkwNjM5Mjc1N2VmYTdmNTFiY2U5MWQ1YzYwMWYzOTRmNw== version: 0.10.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/notes/socket-permission-4081813647fcc8ac.yaml0000664000175100017510000000031215033315272026562 0ustar00mylesmyles--- features: - | Introduced a new configuration option ``metrics_socket_perm`` under the ``oslo_metrics`` group, allowing users to set custom permissions for the Unix domain socket file. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.372503 oslo_metrics-0.12.1.dev1/releasenotes/source/0000775000175100017510000000000015033315273020236 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/2023.1.rst0000664000175100017510000000021015033315272021505 0ustar00mylesmyles=========================== 2023.1 Series Release Notes =========================== .. release-notes:: :branch: unmaintained/2023.1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/2023.2.rst0000664000175100017510000000020215033315272021507 0ustar00mylesmyles=========================== 2023.2 Series Release Notes =========================== .. release-notes:: :branch: stable/2023.2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/2024.1.rst0000664000175100017510000000020215033315272021507 0ustar00mylesmyles=========================== 2024.1 Series Release Notes =========================== .. release-notes:: :branch: stable/2024.1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/2024.2.rst0000664000175100017510000000020215033315272021510 0ustar00mylesmyles=========================== 2024.2 Series Release Notes =========================== .. release-notes:: :branch: stable/2024.2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/2025.1.rst0000664000175100017510000000020215033315272021510 0ustar00mylesmyles=========================== 2025.1 Series Release Notes =========================== .. release-notes:: :branch: stable/2025.1 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.372503 oslo_metrics-0.12.1.dev1/releasenotes/source/_static/0000775000175100017510000000000015033315273021664 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/_static/.placeholder0000664000175100017510000000000015033315272024134 0ustar00mylesmyles././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.372503 oslo_metrics-0.12.1.dev1/releasenotes/source/_templates/0000775000175100017510000000000015033315273022373 5ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/_templates/.placeholder0000664000175100017510000000000015033315272024643 0ustar00mylesmyles././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/conf.py0000664000175100017510000002153315033315272021540 0ustar00mylesmyles# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'openstackdocstheme', 'reno.sphinxext', ] # openstackdocstheme options openstackdocs_repo_name = 'openstack/oslo.metrics' openstackdocs_bug_project = 'oslo.metrics' openstackdocs_bug_tag = '' openstackdocs_auto_name = False # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'oslo.metrics Release Notes' copyright = '2020, oslo.metrics Developers' # Release notes do not need a version in the title, they span # multiple versions. # The full version, including alpha/beta/rc tags. release = '' # The short X.Y version. version = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all # documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'openstackdocs' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_domain_indices = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'oslo.metricsReleaseNotesDoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'oslo.metricsReleaseNotes.tex', 'oslo.metrics Release Notes Documentation', 'oslo.metrics Developers', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # latex_use_parts = False # If true, show page references after internal links. # latex_show_pagerefs = False # If true, show URL addresses after external links. # latex_show_urls = False # Documents to append as an appendix to all manuals. # latex_appendices = [] # If false, no module index is generated. # latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'oslo.metricsReleaseNotes', 'oslo.metrics Release Notes Documentation', ['oslo.metrics Developers'], 1) ] # If true, show URL addresses after external links. # man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'oslo.metricsReleaseNotes', 'oslo.metrics Release Notes Documentation', 'oslo.metrics Developers', 'oslo.metricsReleaseNotes', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. # texinfo_appendices = [] # If false, no module index is generated. # texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. # texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. # texinfo_no_detailmenu = False # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/index.rst0000664000175100017510000000032215033315272022073 0ustar00mylesmyles========================== oslo.metrics Release Notes ========================== .. toctree:: :maxdepth: 1 unreleased 2025.1 2024.2 2024.1 2023.2 2023.1 zed yoga xena wallaby ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/unreleased.rst0000664000175100017510000000014415033315272023115 0ustar00mylesmyles========================== Unreleased Release Notes ========================== .. release-notes:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/wallaby.rst0000664000175100017510000000021415033315272022417 0ustar00mylesmyles============================ Wallaby Series Release Notes ============================ .. release-notes:: :branch: unmaintained/wallaby ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/xena.rst0000664000175100017510000000020015033315272021712 0ustar00mylesmyles========================= Xena Series Release Notes ========================= .. release-notes:: :branch: unmaintained/xena ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/yoga.rst0000664000175100017510000000020015033315272021716 0ustar00mylesmyles========================= Yoga Series Release Notes ========================= .. release-notes:: :branch: unmaintained/yoga ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/releasenotes/source/zed.rst0000664000175100017510000000017415033315272021553 0ustar00mylesmyles======================== Zed Series Release Notes ======================== .. release-notes:: :branch: unmaintained/zed ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/requirements.txt0000664000175100017510000000055215033315272017532 0ustar00mylesmyles# Requirements lower bounds listed here are our best effort to keep them up to # date but we do not test them so no guarantee of having them all correct. If # you find any incorrect lower bounds, let us know or propose a fix. pbr>=3.1.1 # Apache-2.0 # General oslo.utils>=3.41.0 oslo.log>=3.44.0 oslo.config>=6.9.0 # Metrics Exporter prometheus-client>=0.6.0 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1752013499.373503 oslo_metrics-0.12.1.dev1/setup.cfg0000664000175100017510000000164515033315273016074 0ustar00mylesmyles[metadata] name = oslo.metrics author = OpenStack author_email = openstack-discuss@lists.openstack.org summary = Oslo Metrics API description_file = README.rst home_page = https://opendev.org/openstack/oslo.metrics python_requires = >=3.9 classifier = Environment :: OpenStack Intended Audience :: Developers Intended Audience :: Information Technology License :: OSI Approved :: Apache Software License Operating System :: OS Independent Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 Programming Language :: Python :: 3 :: Only Programming Language :: Python :: Implementation :: CPython [files] packages = oslo_metrics [entry_points] console_scripts = oslo-metrics = oslo_metrics.__main__:main [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/setup.py0000664000175100017510000000123215033315272015754 0ustar00mylesmyles# Copyright (c) 2020 LINE Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import setuptools setuptools.setup( setup_requires=['pbr>=2.0.0'], pbr=True) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/test-requirements.txt0000664000175100017510000000012315033315272020501 0ustar00mylesmylesoslotest>=3.2.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 coverage>=4.0 # Apache-2.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1752013498.0 oslo_metrics-0.12.1.dev1/tox.ini0000664000175100017510000000240415033315272015557 0ustar00mylesmyles[tox] minversion = 3.18.0 envlist = py3,pep8 [testenv] allowlist_externals = find deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete stestr run --slowest {posargs} [testenv:pep8] skip_install = true deps = pre-commit commands = pre-commit run -a [testenv:venv] commands = {posargs} [testenv:docs] allowlist_externals = rm deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/doc/requirements.txt commands = rm -fr doc/build sphinx-build -W --keep-going -b html doc/source doc/build/html [testenv:cover] setenv = PYTHON=coverage run --source oslo_metrics --parallel-mode commands = stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml [flake8] show-source = True ignore = H405,W504,F405 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build [hacking] import_exceptions = [testenv:releasenotes] allowlist_externals = rm deps = {[testenv:docs]deps} commands = rm -rf releasenotes/build sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html