Debian Codegraph @

doc/source/admin/telemetry-data-collection.rst

raw
1 .. _telemetry-data-collection:
2
3 ===============
4 Data collection
5 ===============
6
7 The main responsibility of Telemetry in OpenStack is to collect
8 information about the system that can be used by billing systems or
9 interpreted by analytic tooling.
10
11 Collected data can be stored in the form of samples or events in the
12 supported databases, which are listed
13 in :ref:`telemetry-supported-databases`.
14
15 The available data collection mechanisms are:
16
17 Notifications
18 Processing notifications from other OpenStack services, by consuming
19 messages from the configured message queue system.
20
21 Polling
22 Retrieve information directly from the hypervisor or by using the APIs of
23 other OpenStack services.
24
25 Notifications
26 =============
27
28 All OpenStack services send notifications about the executed operations
29 or system state. Several notifications carry information that can be
30 metered. For example, CPU time of a VM instance created by OpenStack
31 Compute service.
32
33 The notification agent is responsible for consuming notifications. This
34 component is responsible for consuming from the message bus and transforming
35 notifications into events and measurement samples.
36
37 By default, the notification agent is configured to build both events and
38 samples. To enable selective data models, set the required pipelines using
39 `pipelines` option under the `[notification]` section.
40
41 Additionally, the notification agent is responsible to send to any supported
42 publisher target such as gnocchi or panko. These services persist the data in
43 configured databases.
44
45 The different OpenStack services emit several notifications about the
46 various types of events that happen in the system during normal
47 operation. Not all these notifications are consumed by the Telemetry
48 service, as the intention is only to capture the billable events and
49 notifications that can be used for monitoring or profiling purposes. The
50 notifications handled are contained under the `ceilometer.sample.endpoint`
51 namespace.
52
53 .. note::
54
55 Some services require additional configuration to emit the
56 notifications. Please see the :ref:`install_controller` for more details.
57
58 .. _meter_definitions:
59
60 Meter definitions
61 -----------------
62
63 The Telemetry service collects a subset of the meters by filtering
64 notifications emitted by other OpenStack services. You can find the meter
65 definitions in a separate configuration file, called
66 ``ceilometer/data/meters.d/meters.yaml``. This enables
67 operators/administrators to add new meters to Telemetry project by updating
68 the ``meters.yaml`` file without any need for additional code changes.
69
70 .. note::
71
72 The ``meters.yaml`` file should be modified with care. Unless intended,
73 do not remove any existing meter definitions from the file. Also, the
74 collected meters can differ in some cases from what is referenced in the
75 documentation.
76
77 It also support loading multiple meter definition files and allow users to add
78 their own meter definitions into several files according to different types of
79 metrics under the directory of ``/etc/ceilometer/meters.d``.
80
81 A standard meter definition looks like:
82
83 .. code-block:: yaml
84
85 ---
86 metric:
87 - name: 'meter name'
88 event_type: 'event name'
89 type: 'type of meter eg: gauge, cumulative or delta'
90 unit: 'name of unit eg: MiB'
91 volume: 'path to a measurable value eg: $.payload.size'
92 resource_id: 'path to resource id eg: $.payload.id'
93 project_id: 'path to project id eg: $.payload.owner'
94 metadata: 'addiitonal key-value data describing resource'
95
96 The definition above shows a simple meter definition with some fields,
97 from which ``name``, ``event_type``, ``type``, ``unit``, and ``volume``
98 are required. If there is a match on the event type, samples are generated
99 for the meter.
100
101 The ``meters.yaml`` file contains the sample
102 definitions for all the meters that Telemetry is collecting from
103 notifications. The value of each field is specified by using JSON path in
104 order to find the right value from the notification message. In order to be
105 able to specify the right field you need to be aware of the format of the
106 consumed notification. The values that need to be searched in the notification
107 message are set with a JSON path starting with ``$.`` For instance, if you need
108 the ``size`` information from the payload you can define it like
109 ``$.payload.size``.
110
111 A notification message may contain multiple meters. You can use ``*`` in
112 the meter definition to capture all the meters and generate samples
113 respectively. You can use wild cards as shown in the following example:
114
115 .. code-block:: yaml
116
117 ---
118 metric:
119 - name: $.payload.measurements.[*].metric.[*].name
120 event_type: 'event_name.*'
121 type: 'delta'
122 unit: $.payload.measurements.[*].metric.[*].unit
123 volume: payload.measurements.[*].result
124 resource_id: $.payload.target
125 user_id: $.payload.initiator.id
126 project_id: $.payload.initiator.project_id
127
128 In the above example, the ``name`` field is a JSON path with matching
129 a list of meter names defined in the notification message.
130
131 You can use complex operations on JSON paths. In the following example,
132 ``volume`` and ``resource_id`` fields perform an arithmetic
133 and string concatenation:
134
135 .. code-block:: yaml
136
137 ---
138 metric:
139 - name: 'compute.node.cpu.idle.percent'
140 event_type: 'compute.metrics.update'
141 type: 'gauge'
142 unit: 'percent'
143 volume: payload.metrics[?(@.name='cpu.idle.percent')].value * 100
144 resource_id: $.payload.host + "_" + $.payload.nodename
145
146 You can use the ``timedelta`` plug-in to evaluate the difference in seconds
147 between two ``datetime`` fields from one notification.
148
149 .. code-block:: yaml
150
151 ---
152 metric:
153 - name: 'compute.instance.booting.time'
154 event_type: 'compute.instance.create.end'
155 type: 'gauge'
156 unit: 'sec'
157 volume:
158 fields: [$.payload.created_at, $.payload.launched_at]
159 plugin: 'timedelta'
160 project_id: $.payload.tenant_id
161 resource_id: $.payload.instance_id
162
163 .. _Polling-Configuration:
164
165 Polling
166 =======
167
168 The Telemetry service is intended to store a complex picture of the
169 infrastructure. This goal requires additional information than what is
170 provided by the events and notifications published by each service. Some
171 information is not emitted directly, like resource usage of the VM
172 instances.
173
174 Therefore Telemetry uses another method to gather this data by polling
175 the infrastructure including the APIs of the different OpenStack
176 services and other assets, like hypervisors. The latter case requires
177 closer interaction with the compute hosts. To solve this issue,
178 Telemetry uses an agent based architecture to fulfill the requirements
179 against the data collection.
180
181 Configuration
182 -------------
183
184 Polling rules are defined by the `polling.yaml` file. It defines the pollsters
185 to enable and the interval they should be polled.
186
187 Each source configuration encapsulates meter name matching which matches
188 against the entry point of pollster. It also includes: polling
189 interval determination, optional resource enumeration or discovery.
190
191 All samples generated by polling are placed on the queue to be handled by
192 the pipeline configuration loaded in the notification agent.
193
194 The polling definition may look like the following::
195
196 ---
197 sources:
198 - name: 'source name'
199 interval: 'how often the samples should be generated'
200 meters:
201 - 'meter filter'
202 resources:
203 - 'list of resource URLs'
204 discovery:
205 - 'list of discoverers'
206
207 The *interval* parameter in the sources section defines the cadence of sample
208 generation in seconds.
209
210 Polling plugins are invoked according to each source's section whose *meters*
211 parameter matches the plugin's meter name. Its matching logic functions the
212 same as pipeline filtering.
213
214 The optional *resources* section of a polling source allows a list of
215 static resource URLs to be configured. An amalgamated list of all
216 statically defined resources are passed to individual pollsters for polling.
217
218 The optional *discovery* section of a polling source contains the list of
219 discoverers. These discoverers can be used to dynamically discover the
220 resources to be polled by the pollsters.
221
222 If both *resources* and *discovery* are set, the final resources passed to the
223 pollsters will be the combination of the dynamic resources returned by the
224 discoverers and the static resources defined in the *resources* section.
225
226 Agents
227 ------
228
229 There are three types of agents supporting the polling mechanism, the
230 ``compute agent``, the ``central agent``, and the ``IPMI agent``. Under
231 the hood, all the types of polling agents are the same
232 ``ceilometer-polling`` agent, except that they load different polling
233 plug-ins (pollsters) from different namespaces to gather data. The following
234 subsections give further information regarding the architectural and
235 configuration details of these components.
236
237 Running :command:`ceilometer-agent-compute` is exactly the same as:
238
239 .. code-block:: console
240
241 $ ceilometer-polling --polling-namespaces compute
242
243 Running :command:`ceilometer-agent-central` is exactly the same as:
244
245 .. code-block:: console
246
247 $ ceilometer-polling --polling-namespaces central
248
249 Running :command:`ceilometer-agent-ipmi` is exactly the same as:
250
251 .. code-block:: console
252
253 $ ceilometer-polling --polling-namespaces ipmi
254
255 Compute agent
256 ~~~~~~~~~~~~~
257
258 This agent is responsible for collecting resource usage data of VM
259 instances on individual compute nodes within an OpenStack deployment.
260 This mechanism requires a closer interaction with the hypervisor,
261 therefore a separate agent type fulfills the collection of the related
262 meters, which is placed on the host machines to retrieve this
263 information locally.
264
265 A Compute agent instance has to be installed on each and every compute
266 node, installation instructions can be found in the :ref:`install_compute`
267 section in the Installation Tutorials and Guides.
268
269 The list of supported hypervisors can be found in
270 :ref:`telemetry-supported-hypervisors`. The Compute agent uses the API of the
271 hypervisor installed on the compute hosts. Therefore, the supported meters may
272 be different in case of each virtualization back end, as each inspection tool
273 provides a different set of meters.
274
275 The list of collected meters can be found in :ref:`telemetry-compute-meters`.
276 The support column provides the information about which meter is available for
277 each hypervisor supported by the Telemetry service.
278
279 Central agent
280 ~~~~~~~~~~~~~
281
282 This agent is responsible for polling public REST APIs to retrieve additional
283 information on OpenStack resources not already surfaced via notifications.
284
285 Some of the services polled with this agent are:
286
287 - OpenStack Networking
288 - OpenStack Object Storage
289 - OpenStack Block Storage
290
291 To install and configure this service use the :ref:`install_rdo`
292 section in the Installation Tutorials and Guides.
293
294 Although Ceilometer has a set of default polling agents, operators can
295 add new pollsters dynamically via the dynamic pollsters subsystem
296 :ref:`telemetry_dynamic_pollster`.
297
298
299 .. _telemetry-ipmi-agent:
300
301 IPMI agent
302 ~~~~~~~~~~
303
304 This agent is responsible for collecting IPMI sensor data and Intel Node
305 Manager data on individual compute nodes within an OpenStack deployment.
306 This agent requires an IPMI capable node with the ipmitool utility installed,
307 which is commonly used for IPMI control on various Linux distributions.
308
309 An IPMI agent instance could be installed on each and every compute node
310 with IPMI support, except when the node is managed by the Bare metal
311 service and the ``conductor.send_sensor_data`` option is set to ``true``
312 in the Bare metal service. It is no harm to install this agent on a
313 compute node without IPMI support, as the agent checks for the hardware and
314 if IPMI support is not available, returns empty data. It is suggested that you
315 install the IPMI agent only on an IPMI capable node for performance reasons.
316
317 The list of collected meters can be found in
318 :ref:`telemetry-bare-metal-service`.
319
320 .. note::
321
322 Do not deploy both the IPMI agent and the Bare metal service on one
323 compute node. If ``conductor.send_sensor_data`` is set, this
324 misconfiguration causes duplicated IPMI sensor samples.