File: usage.rst

package info (click to toggle)
python-oslo.metrics 0.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 280 kB
  • sloc: python: 434; makefile: 26; sh: 2
file content (93 lines) | stat: -rw-r--r-- 3,489 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
=====
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.