| 1 |
.. _telemetry-data-pipelines: |
| 2 |
|
| 3 |
============================= |
| 4 |
Data processing and pipelines |
| 5 |
============================= |
| 6 |
|
| 7 |
The mechanism by which data is processed is called a pipeline. Pipelines, |
| 8 |
at the configuration level, describe a coupling between sources of data and |
| 9 |
the corresponding sinks for publication of data. This |
| 10 |
functionality is handled by the notification agents. |
| 11 |
|
| 12 |
A source is a producer of data: ``samples`` or ``events``. In effect, it is a |
| 13 |
set of notification handlers emitting datapoints for a set of matching meters |
| 14 |
and event types. |
| 15 |
|
| 16 |
Each source configuration encapsulates name matching and mapping |
| 17 |
to one or more sinks for publication. |
| 18 |
|
| 19 |
A sink, on the other hand, is a consumer of data, providing logic for |
| 20 |
the publication of data emitted from related sources. |
| 21 |
|
| 22 |
In effect, a sink describes a list of one or more publishers. |
| 23 |
|
| 24 |
.. _telemetry-pipeline-configuration: |
| 25 |
|
| 26 |
Pipeline configuration |
| 27 |
~~~~~~~~~~~~~~~~~~~~~~ |
| 28 |
|
| 29 |
The notification agent supports two pipelines: one that handles samples and |
| 30 |
another that handles events. The pipelines can be enabled and disabled by |
| 31 |
setting `pipelines` option in the `[notifications]` section. |
| 32 |
|
| 33 |
The actual configuration of each pipelines is, by default, stored in separate |
| 34 |
configuration files: ``pipeline.yaml`` and ``event_pipeline.yaml``. The |
| 35 |
location of the configuration files can be set by the ``pipeline_cfg_file`` and |
| 36 |
``event_pipeline_cfg_file`` options listed in :ref:`configuring` |
| 37 |
|
| 38 |
The meter pipeline definition looks like: |
| 39 |
|
| 40 |
.. code-block:: yaml |
| 41 |
|
| 42 |
--- |
| 43 |
sources: |
| 44 |
- name: 'source name' |
| 45 |
meters: |
| 46 |
- 'meter filter' |
| 47 |
sinks: |
| 48 |
- 'sink name' |
| 49 |
sinks: |
| 50 |
- name: 'sink name' |
| 51 |
publishers: |
| 52 |
- 'list of publishers' |
| 53 |
|
| 54 |
There are several ways to define the list of meters for a pipeline |
| 55 |
source. The list of valid meters can be found in :ref:`telemetry-measurements`. |
| 56 |
There is a possibility to define all the meters, or just included or excluded |
| 57 |
meters, with which a source should operate: |
| 58 |
|
| 59 |
- To include all meters, use the ``*`` wildcard symbol. It is highly |
| 60 |
advisable to select only the meters that you intend on using to avoid |
| 61 |
flooding the metering database with unused data. |
| 62 |
|
| 63 |
- To define the list of meters, use either of the following: |
| 64 |
|
| 65 |
- To define the list of included meters, use the ``meter_name`` |
| 66 |
syntax. |
| 67 |
|
| 68 |
- To define the list of excluded meters, use the ``!meter_name`` |
| 69 |
syntax. |
| 70 |
|
| 71 |
.. note:: |
| 72 |
|
| 73 |
The OpenStack Telemetry service does not have any duplication check |
| 74 |
between pipelines, and if you add a meter to multiple pipelines then it is |
| 75 |
assumed the duplication is intentional and may be stored multiple |
| 76 |
times according to the specified sinks. |
| 77 |
|
| 78 |
The above definition methods can be used in the following combinations: |
| 79 |
|
| 80 |
- Use only the wildcard symbol. |
| 81 |
|
| 82 |
- Use the list of included meters. |
| 83 |
|
| 84 |
- Use the list of excluded meters. |
| 85 |
|
| 86 |
- Use wildcard symbol with the list of excluded meters. |
| 87 |
|
| 88 |
.. note:: |
| 89 |
|
| 90 |
At least one of the above variations should be included in the |
| 91 |
meters section. Included and excluded meters cannot co-exist in the |
| 92 |
same pipeline. Wildcard and included meters cannot co-exist in the |
| 93 |
same pipeline definition section. |
| 94 |
|
| 95 |
The publishers section contains the list of publishers, where the |
| 96 |
samples data should be sent. |
| 97 |
|
| 98 |
Similarly, the event pipeline definition looks like: |
| 99 |
|
| 100 |
.. code-block:: yaml |
| 101 |
|
| 102 |
--- |
| 103 |
sources: |
| 104 |
- name: 'source name' |
| 105 |
events: |
| 106 |
- 'event filter' |
| 107 |
sinks: |
| 108 |
- 'sink name' |
| 109 |
sinks: |
| 110 |
- name: 'sink name' |
| 111 |
publishers: |
| 112 |
- 'list of publishers' |
| 113 |
|
| 114 |
The event filter uses the same filtering logic as the meter pipeline. |
| 115 |
|
| 116 |
.. _publishing: |
| 117 |
|
| 118 |
Publishers |
| 119 |
---------- |
| 120 |
|
| 121 |
The Telemetry service provides several transport methods to transfer the |
| 122 |
data collected to an external system. The consumers of this data are widely |
| 123 |
different, like monitoring systems, for which data loss is acceptable and |
| 124 |
billing systems, which require reliable data transportation. Telemetry provides |
| 125 |
methods to fulfill the requirements of both kind of systems. |
| 126 |
|
| 127 |
The publisher component makes it possible to save the data into persistent |
| 128 |
storage through the message bus or to send it to one or more external |
| 129 |
consumers. One chain can contain multiple publishers. |
| 130 |
|
| 131 |
To solve this problem, the multi-publisher can |
| 132 |
be configured for each data point within the Telemetry service, allowing |
| 133 |
the same technical meter or event to be published multiple times to |
| 134 |
multiple destinations, each potentially using a different transport. |
| 135 |
|
| 136 |
The following publisher types are supported: |
| 137 |
|
| 138 |
gnocchi (default) |
| 139 |
````````````````` |
| 140 |
|
| 141 |
When the gnocchi publisher is enabled, measurement and resource information is |
| 142 |
pushed to gnocchi for time-series optimized storage. Gnocchi must be registered |
| 143 |
in the Identity service as Ceilometer discovers the exact path via the Identity |
| 144 |
service. |
| 145 |
|
| 146 |
More details on how to enable and configure gnocchi can be found on its |
| 147 |
`official documentation page <https://gnocchi.osci.io>`__. |
| 148 |
|
| 149 |
prometheus |
| 150 |
`````````` |
| 151 |
|
| 152 |
Metering data can be send to the `pushgateway |
| 153 |
<https://github.com/prometheus/pushgateway>`__ of Prometheus by using: |
| 154 |
|
| 155 |
``prometheus://pushgateway-host:9091/metrics/job/openstack-telemetry`` |
| 156 |
|
| 157 |
With this publisher, timestamp are not sent to Prometheus due to Prometheus |
| 158 |
Pushgateway design. All timestamps are set at the time it scrapes the metrics |
| 159 |
from the Pushgateway and not when the metric was polled on the OpenStack |
| 160 |
services. |
| 161 |
|
| 162 |
In order to get timeseries in Prometheus that looks like the reality (but with |
| 163 |
the lag added by the Prometheus scrapping mechanism). The `scrape_interval` for |
| 164 |
the pushgateway must be lower and a multiple of the Ceilometer polling |
| 165 |
interval. |
| 166 |
|
| 167 |
You can read more `here <https://github.com/prometheus/pushgateway#about-timestamps>`__ |
| 168 |
|
| 169 |
Due to this, this is not recommended to use this publisher for billing purpose |
| 170 |
as timestamps in Prometheus will not be exact. |
| 171 |
|
| 172 |
notifier |
| 173 |
```````` |
| 174 |
|
| 175 |
The notifier publisher can be specified in the form of |
| 176 |
``notifier://?option1=value1&option2=value2``. It emits data over AMQP using |
| 177 |
oslo.messaging. Any consumer can then subscribe to the published topic |
| 178 |
for additional processing. |
| 179 |
|
| 180 |
The following customization options are available: |
| 181 |
|
| 182 |
``per_meter_topic`` |
| 183 |
The value of this parameter is 1. It is used for publishing the samples on |
| 184 |
additional ``metering_topic.sample_name`` topic queue besides the |
| 185 |
default ``metering_topic`` queue. |
| 186 |
|
| 187 |
``policy`` |
| 188 |
Used for configuring the behavior for the case, when the |
| 189 |
publisher fails to send the samples, where the possible predefined |
| 190 |
values are: |
| 191 |
|
| 192 |
default |
| 193 |
Used for waiting and blocking until the samples have been sent. |
| 194 |
|
| 195 |
drop |
| 196 |
Used for dropping the samples which are failed to be sent. |
| 197 |
|
| 198 |
queue |
| 199 |
Used for creating an in-memory queue and retrying to send the |
| 200 |
samples on the queue in the next samples publishing period (the |
| 201 |
queue length can be configured with ``max_queue_length``, where |
| 202 |
1024 is the default value). |
| 203 |
|
| 204 |
``topic`` |
| 205 |
The topic name of the queue to publish to. Setting this will override the |
| 206 |
default topic defined by ``metering_topic`` and ``event_topic`` options. |
| 207 |
This option can be used to support multiple consumers. |
| 208 |
|
| 209 |
udp |
| 210 |
``` |
| 211 |
|
| 212 |
This publisher can be specified in the form of ``udp://<host>:<port>/``. It |
| 213 |
emits metering data over UDP. |
| 214 |
|
| 215 |
file |
| 216 |
```` |
| 217 |
|
| 218 |
The file publisher can be specified in the form of |
| 219 |
``file://path?option1=value1&option2=value2``. This publisher |
| 220 |
records metering data into a file. |
| 221 |
|
| 222 |
.. note:: |
| 223 |
|
| 224 |
If a file name and location is not specified, the ``file`` publisher |
| 225 |
does not log any meters, instead it logs a warning message in |
| 226 |
the configured log file for Telemetry. |
| 227 |
|
| 228 |
The following options are available for the ``file`` publisher: |
| 229 |
|
| 230 |
``max_bytes`` |
| 231 |
When this option is greater than zero, it will cause a rollover. |
| 232 |
When the specified size is about to be exceeded, the file is closed and a |
| 233 |
new file is silently opened for output. If its value is zero, rollover |
| 234 |
never occurs. |
| 235 |
|
| 236 |
``backup_count`` |
| 237 |
If this value is non-zero, an extension will be appended to the |
| 238 |
filename of the old log, as '.1', '.2', and so forth until the |
| 239 |
specified value is reached. The file that is written and contains |
| 240 |
the newest data is always the one that is specified without any |
| 241 |
extensions. |
| 242 |
|
| 243 |
``json`` |
| 244 |
If this option is present, will force ceilometer to write json format |
| 245 |
into the file. |
| 246 |
|
| 247 |
http |
| 248 |
```` |
| 249 |
|
| 250 |
The Telemetry service supports sending samples to an external HTTP |
| 251 |
target. The samples are sent without any modification. To set this |
| 252 |
option as the notification agents' target, set ``http://`` as a publisher |
| 253 |
endpoint in the pipeline definition files. The HTTP target should be set along |
| 254 |
with the publisher declaration. For example, additional configuration options |
| 255 |
can be passed in: ``http://localhost:80/?option1=value1&option2=value2`` |
| 256 |
|
| 257 |
The following options are available: |
| 258 |
|
| 259 |
``timeout`` |
| 260 |
The number of seconds before HTTP request times out. |
| 261 |
|
| 262 |
``max_retries`` |
| 263 |
The number of times to retry a request before failing. |
| 264 |
|
| 265 |
``batch`` |
| 266 |
If false, the publisher will send each sample and event individually, |
| 267 |
whether or not the notification agent is configured to process in batches. |
| 268 |
|
| 269 |
``verify_ssl`` |
| 270 |
If false, the ssl certificate verification is disabled. |
| 271 |
|
| 272 |
The default publisher is ``gnocchi``, without any additional options |
| 273 |
specified. A sample ``publishers`` section in the |
| 274 |
``/etc/ceilometer/pipeline.yaml`` looks like the following: |
| 275 |
|
| 276 |
.. code-block:: yaml |
| 277 |
|
| 278 |
publishers: |
| 279 |
- gnocchi:// |
| 280 |
- udp://10.0.0.2:1234 |
| 281 |
- notifier://?policy=drop&max_queue_length=512&topic=custom_target |