|
| 1 | +.. _cpt_telemetry: |
| 2 | + |
| 3 | +Client Telemetry Aggregators |
| 4 | +============================ |
| 5 | + |
| 6 | +It is possible to configure the client to send in regular intervals the performance counters listed by ``cvmfs_talk internal affairs``. |
| 7 | +By default, an aggregator is available that exposes the counters in InfluxDB data format. |
| 8 | +It can easily be replaced by any other aggregator in a form of a source code plugin. |
| 9 | + |
| 10 | +Independent of the aggregator following 2 client parameters must be set: |
| 11 | +:: |
| 12 | + |
| 13 | + CVMFS_TELEMETRY_SEND=ON |
| 14 | + CVMFS_TELEMETRY_RATE=<rate in seconds> # minimum send rate >= 5 sec |
| 15 | + |
| 16 | + |
| 17 | +Influx Telemetry Aggregator |
| 18 | +--------------------------- |
| 19 | + |
| 20 | +The Influx Telemetry Aggregator sends per timestamp two versions of the counters: |
| 21 | +their absolute values and the delta between two timestamps to a socket. |
| 22 | +For this, the measurement name given by ``CVMFS_INFLUX_METRIC_NAME`` is extended with either ``_absolute`` or ``_delta``. |
| 23 | + |
| 24 | +Mandatory client parameters for the Influx Telemetry Aggregator are |
| 25 | + |
| 26 | +:: |
| 27 | + |
| 28 | + CVMFS_INFLUX_HOST=localhost # IP address |
| 29 | + CVMFS_INFLUX_PORT=8092 # Port |
| 30 | + CVMFS_INFLUX_METRIC_NAME=<measurement name> # "Table" name |
| 31 | + |
| 32 | +And optional parameters are |
| 33 | + |
| 34 | +:: |
| 35 | + |
| 36 | + CVMFS_INFLUX_EXTRA_TAGS="some_tag=42,some_tag2=27" # always included |
| 37 | + CVMFS_INFLUX_EXTRA_FIELDS="somefield=3" # not included in delta |
| 38 | + |
| 39 | +The general layout of the data send is |
| 40 | + |
| 41 | +:: |
| 42 | + |
| 43 | + # for absolute |
| 44 | + CVMFS_INFLUX_METRIC_NAME_absolute,repo=@fqrn,CVMFS_INFLUX_EXTRA_TAGS countername=value,...,CVMFS_INFLUX_EXTRA_FIELDS timestamp |
| 45 | + |
| 46 | + # for delta (no CVMFS_INFLUX_EXTRA_FIELDS) |
| 47 | + CVMFS_INFLUX_METRIC_NAME_delta,repo=@fqrn,CVMFS_INFLUX_EXTRA_TAGS countername=value_new - value_old,... timestamp |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +.. warning:: |
| 52 | + In the output, counters are only included if they have been used at least once (value != 0). |
| 53 | + And for the very first measurement no delta values are available. |
| 54 | + |
| 55 | +Writing Your Own Aggregator |
| 56 | +--------------------------- |
| 57 | + |
| 58 | +The ``TelemetryAggregator`` base class consists of a loop that for each time step |
| 59 | +snapshots the counters (saved to ``counters_``), and calls ``PushMetrics()``. |
| 60 | +``PushMetrics()`` needs to be overwritten by your own aggregator to perform all manipulations |
| 61 | +needed for the counters and the sending/storing of the counters. |
| 62 | + |
| 63 | +To write your own aggregator you need the following parts: |
| 64 | + |
| 65 | +* Your aggregator must inherit from ``TelemetryAggregator`` |
| 66 | +* Your aggregator's constructor must take care of additional client parameters needed. |
| 67 | + In case your object is incorrectly constructed, ``is_zombie_`` **MUST** be set to ``true``. |
| 68 | +* Your aggregator must overwrite ``PushMetrics()`` |
| 69 | +* Create a new value for your aggregator in enum ``TelemetrySelector`` |
| 70 | +* Add your aggregator inside the ``Create()`` of ``TelemetryAggregator`` using the newly created value of ``TelemetrySelector`` |
| 71 | +* Change in ``mountpoint.cc`` the ``TelemetrySelector`` used in ``perf::TelemetryAggregator::Create`` |
| 72 | + |
| 73 | +.. note:: |
| 74 | + |
| 75 | + Please feel free to contribute your aggregator to the CVMFS project, so we can expand the number of |
| 76 | + available aggregators to all users. |
| 77 | + |
| 78 | + |
0 commit comments