...
Ceilometer provides the possibility to submit samples via the REST API to allow users to send custom samples into this service. If The samples that can be sent to Telemetry are not limited to the actual existing meters. There is a possibility to provide data for any new, customer defined counter by filling out all the required fields of the POST request. If the sample corresponds to an existing meter, then the fields like meter-type
and meter name should be matched accordingly.
A standard meter definition looks like:
Code Block | ||
---|---|---|
| ||
metric:
- name: 'meter name'
event_type: 'event name'
type: 'type of meter eg: gauge, cumulative or delta'
unit: 'name of unit eg: MB'
volume: 'path to a measurable value eg: $.payload.size'
resource_id: 'path to resource id eg: $.payload.id'
project_id: 'path to project id eg: $.payload.owner' |
...
eg: $.payload.owner'
|
The meter.yaml
file, it contains the sample definitions for all the meters that Telemetry can collect.The required fields for sending a sample using the command-line client are:
ID of the corresponding resource. (
--resource-id
)Name of meter. (
--meter-name
)Type of meter. (
--meter-type
)Predefined meter types:
- Gauge
- Delta
- Cumulative
Unit of meter. (
--meter-unit
)Volume of sample. (
--sample-volume
)
POST /v2/meters/(meter_name)
Post a list of new Samples to Telemetry.
Parameters: |
|
---|---|
Return type: |
Ceilometer OldSample schema
Code Block | ||
---|---|---|
| ||
{ "counter_name": "instance", "counter_type": "gauge", "counter_unit": "instance", "counter_volume": 1.0, "message_id": "5460acce-4fd6-480d-ab18-9735ec7b1996", "project_id": "35b17138-b364-4e6a-a131-8f3099c5be68", "recorded_at": "2015-01-01T12:00:00", "resource_id": "bd9431c1-8d69-4ad3-803a-8d4a6b89fd36", "resource_metadata": { "name1": "value1", "name2": "value2" }, "source": "openstack", "timestamp": "2015-01-01T12:00:00", "user_id": "efd87807-12d2-4b38-9c70-5f5c2ac427ff" } |
...
http://docs.openstack.org/admin-guide/telemetry-data-collection.html
http://docs.openstack.org/developer/ceilometer/webapi/v2.html#samples-and-statistics