| 1 |
===== |
| 2 |
Usage |
| 3 |
===== |
| 4 |
|
| 5 |
A simple example of oslo.metrics in use:: |
| 6 |
|
| 7 |
$ oslo-metrics |
| 8 |
2020-06-11 15:59:53.459 5435 INFO oslo.metrics.__main__ [-] Start oslo.metrics |
| 9 |
|
| 10 |
Testing with DevStack |
| 11 |
--------------------- |
| 12 |
|
| 13 |
This section describes how to test out oslo.metrics and collect oslo.messaging metric data using Devstack. |
| 14 |
|
| 15 |
Download DevStack |
| 16 |
~~~~~~~~~~~~~~~~~ |
| 17 |
|
| 18 |
.. code-block:: console |
| 19 |
|
| 20 |
$ git clone https://opendev.org/openstack/devstack |
| 21 |
$ cd devstack |
| 22 |
|
| 23 |
The ``devstack`` repo contains a script that installs OpenStack and |
| 24 |
templates for configuration files. |
| 25 |
|
| 26 |
Create a local.conf |
| 27 |
~~~~~~~~~~~~~~~~~~~ |
| 28 |
|
| 29 |
Create a ``local.conf`` file with four passwords preset at the root of the |
| 30 |
devstack git repo. |
| 31 |
|
| 32 |
.. code-block:: ini |
| 33 |
|
| 34 |
[[local|localrc]] |
| 35 |
ADMIN_PASSWORD=secret |
| 36 |
DATABASE_PASSWORD=$ADMIN_PASSWORD |
| 37 |
RABBIT_PASSWORD=$ADMIN_PASSWORD |
| 38 |
SERVICE_PASSWORD=$ADMIN_PASSWORD |
| 39 |
LIBS_FROM_GIT=oslo.messaging |
| 40 |
|
| 41 |
[[post-config|$NOVA_CONF]] |
| 42 |
[oslo_messaging_metrics] |
| 43 |
metrics_enabled = True |
| 44 |
|
| 45 |
This is the minimum required config to get started with Devstack including |
| 46 |
oslo.metrics. |
| 47 |
|
| 48 |
Start the install |
| 49 |
~~~~~~~~~~~~~~~~~ |
| 50 |
|
| 51 |
.. code-block:: console |
| 52 |
|
| 53 |
$ ./stack.sh |
| 54 |
|
| 55 |
This will take a 15 - 20 minutes, largely depending on the speed of |
| 56 |
your internet connection. Many git trees and packages will be |
| 57 |
installed during this process. |
| 58 |
|
| 59 |
Start the Metrics Server |
| 60 |
~~~~~~~~~~~~~~~~~~~~~~~~ |
| 61 |
|
| 62 |
.. code-block:: console |
| 63 |
|
| 64 |
$ oslo-metrics |
| 65 |
|
| 66 |
This command will start oslo.metrics server and start collecting |
| 67 |
oslo.messaging metrics sending from OpenStack services. |
| 68 |
|
| 69 |
oslo.metrics exporter will serve on port 3000 by default. |
| 70 |
|
| 71 |
Example Output |
| 72 |
~~~~~~~~~~~~~~ |
| 73 |
|
| 74 |
An example of oslo.metrics collecting metrics from Nova: |
| 75 |
|
| 76 |
.. code-block:: console |
| 77 |
|
| 78 |
ubuntu@devstack:~/devstack$ oslo-metrics |
| 79 |
2021-06-12 14:32:26.091 466289 INFO oslo.metrics.__main__ [-] Start oslo.metrics |
| 80 |
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 |
| 81 |
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 |
| 82 |
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': ''} |
| 83 |
2021-06-12 14:57:50.633 466289 INFO oslo.metrics.message_router [-] Perform action observe for rpc_client_processing_seconds metrics |
| 84 |
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 |
| 85 |
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 |
| 86 |
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': ''} |
| 87 |
2021-06-12 14:57:50.633 466289 INFO oslo.metrics.message_router [-] Perform action inc for rpc_client_invocation_end_total metrics` |
| 88 |
|
| 89 |
Gathering Metrics |
| 90 |
~~~~~~~~~~~~~~~~~ |
| 91 |
|
| 92 |
To gather metrics from oslo.metrics, configure Prometheus to scrape from port |
| 93 |
3000 where oslo.metrics is running. |