### Start and enable Ceilometer services Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-compute-rdo.md Starts the Ceilometer agent and configures it to start on system boot. Also starts and enables the optional IPMI service. ```bash # systemctl enable openstack-ceilometer-compute.service # systemctl start openstack-ceilometer-compute.service # systemctl enable openstack-ceilometer-ipmi.service (optional) # systemctl start openstack-ceilometer-ipmi.service (optional) ``` -------------------------------- ### Install Ceilometer packages Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Installs the necessary ceilometer agent packages using apt-get. ```console # apt-get install ceilometer-agent-notification \ ceilometer-agent-central ``` -------------------------------- ### Install Gnocchi packages Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Installs the Gnocchi API, metric daemon, and client using apt-get. ```bash # apt-get install gnocchi-api gnocchi-metricd python3-gnocchiclient ``` -------------------------------- ### Install uWSGI packages Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Installs uWSGI packages required for the Gnocchi API. ```bash # apt-get install uwsgi-plugin-python3 uwsgi ``` -------------------------------- ### Start and enable Ceilometer services Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-rdo.md Starts the Ceilometer notification and central services and configures them to start on system boot. ```bash # systemctl enable openstack-ceilometer-notification.service \ openstack-ceilometer-central.service # systemctl start openstack-ceilometer-notification.service \ openstack-ceilometer-central.service ``` -------------------------------- ### Enable and start Gnocchi services Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-rdo.md Enables the Gnocchi API and metricd services to start on boot and then starts them. ```bash # systemctl enable gnocchi-api.service gnocchi-metricd.service # systemctl start gnocchi-api.service gnocchi-metricd.service ``` -------------------------------- ### Install tox Source: https://github.com/openstack/ceilometer/blob/master/doc/source/contributor/testing.md Command to install the tox testing tool. ```bash $ sudo pip install tox ``` -------------------------------- ### Initialize Gnocchi Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Runs the Gnocchi database upgrade command. ```bash gnocchi-upgrade ``` -------------------------------- ### Create ceilometer user Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Creates the 'ceilometer' user and displays its details. ```bash $ openstack user create --domain default --password-prompt ceilometer User Password: Repeat User Password: +-----------+----------------------------------+ | Field | Value | +-----------+----------------------------------+ | domain_id | e0353a670a9e496da891347c589539e9 | | enabled | True | | id | c859c96f57bd4989a8ea1a0b1d8ff7cd | | name | ceilometer | +-----------+----------------------------------+ ``` -------------------------------- ### Install ceilometer-agent-compute and ceilometer-agent-ipmi Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-compute-ubuntu.md Installs the necessary Ceilometer agent packages for compute nodes. ```bash # apt-get install ceilometer-agent-compute # apt-get install ceilometer-agent-ipmi (optional) ``` -------------------------------- ### Install python-ceilometermiddleware package Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/swift/install-swift-ubuntu.md Install the necessary Python package for Ceilometer middleware. ```bash # apt-get install python-ceilometermiddleware ``` -------------------------------- ### Create ceilometer service entity Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Creates the 'ceilometer' service entity with type 'metering'. ```bash $ openstack service create --name ceilometer \ --description "Telemetry" metering +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | Telemetry | | enabled | True | | id | 5fb7fd1bb2954fddb378d4031c28c0e4 | | name | ceilometer | | type | metering | +-------------+----------------------------------+ ``` -------------------------------- ### Create Gnocchi database Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Creates a new database named 'gnocchi'. ```sql CREATE DATABASE gnocchi; ``` -------------------------------- ### Create Ceilometer resources in Gnocchi Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Runs the ceilometer-upgrade command to create necessary resources in Gnocchi. ```console # ceilometer-upgrade ``` -------------------------------- ### Install Ceilometer packages Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-rdo.md Installs the notification and central packages for Ceilometer using dnf. ```bash # dnf install openstack-ceilometer-notification \ openstack-ceilometer-central ``` -------------------------------- ### Connect to MySQL database Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Connects to the MySQL server as the root user. ```bash $ mysql -u root -p ``` -------------------------------- ### Install Ceilometer compute packages Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-compute-rdo.md Installs the necessary Ceilometer compute packages, including an optional IPMI package. ```bash # dnf install openstack-ceilometer-compute # dnf install openstack-ceilometer-ipmi (optional) ``` -------------------------------- ### Create gnocchi user Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Creates the 'gnocchi' user and displays its details. ```bash $ openstack user create --domain default --password-prompt gnocchi User Password: Repeat User Password: +-----------+----------------------------------+ | Field | Value | +-----------+----------------------------------+ | domain_id | e0353a670a9e496da891347c589539e9 | | enabled | True | | id | 8bacd064f6434ef2b6bbfbedb79b0318 | | name | gnocchi | +-----------+----------------------------------+ ``` -------------------------------- ### Example Definitions File Source: https://github.com/openstack/ceilometer/blob/master/doc/source/contributor/events.md An example YAML file defining event types and traits, including nested structures and trait plugins. ```yaml --- - event_type: compute.instance.* traits: &instance_traits user_id: fields: payload.user_id instance_id: fields: payload.instance_id host: fields: publisher_id plugin: name: split parameters: segment: 1 max_split: 1 service_name: fields: publisher_id plugin: split instance_type_id: type: int fields: payload.instance_type_id os_architecture: fields: payload.image_meta.'org.openstack__1__architecture' launched_at: type: datetime fields: payload.launched_at deleted_at: type: datetime fields: payload.deleted_at - event_type: - compute.instance.exists - compute.instance.update traits: <<: *instance_traits audit_period_beginning: type: datetime fields: payload.audit_period_beginning audit_period_ending: type: datetime fields: payload.audit_period_ending ``` -------------------------------- ### Install uWSGI packages Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-rdo.md Installs the necessary uWSGI packages for running the Gnocchi API. ```bash # dnf install uwsgi-plugin-common uwsgi-plugin-python3 uwsgi ``` -------------------------------- ### Install Gnocchi packages Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-rdo.md Installs the Gnocchi API, metric daemon, and client using dnf. ```bash # dnf install gnocchi-api gnocchi-metricd python3-gnocchiclient ``` -------------------------------- ### Create Metric Endpoint Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md This snippet shows how to create an OpenStack endpoint for the metric service and the resulting output. ```bash | url | http://controller:8041 | +--------------+----------------------------------+ $ openstack endpoint create --region RegionOne \ metric admin http://controller:8041 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | b2c00566d0604551b5fe1540c699db3d | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 205978b411674e5a9990428f81d69384 | | service_name | gnocchi | | service_type | metric | | url | http://controller:8041 | +--------------+----------------------------------+ ``` -------------------------------- ### Install python3-ceilometermiddleware package Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/swift/install-swift-rdo.md Install the necessary Python package for Ceilometer middleware. ```bash # dnf install python3-ceilometermiddleware ``` -------------------------------- ### Create public endpoint for Metric service Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Creates the public endpoint for the Metric service (Gnocchi). ```bash $ openstack endpoint create --region RegionOne \ metric public http://controller:8041 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | b808b67b848d443e9eaaa5e5d796970c | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 205978b411674e5a9990428f81d69384 | | service_name | gnocchi | | service_type | metric | | url | http://controller:8041 | +--------------+----------------------------------+ ``` -------------------------------- ### Create gnocchi service entity Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Creates the 'gnocchi' service entity with type 'metric'. ```bash $ openstack service create --name gnocchi \ --description "Metric Service" metric +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | Metric Service | | enabled | True | | id | 205978b411674e5a9990428f81d69384 | | name | gnocchi | | type | metric | +-------------+----------------------------------+ ``` -------------------------------- ### Restart Gnocchi services Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Restarts the Apache and Gnocchi metricd services. ```bash # systemctl restart apache2 # systemctl restart gnocchi-metricd ``` -------------------------------- ### Restart Telemetry services Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Restarts the ceilometer agent services. ```console # systemctl restart ceilometer-agent-central # systemctl restart ceilometer-agent-notification ``` -------------------------------- ### Create internal endpoint for Metric service Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Creates the internal endpoint for the Metric service (Gnocchi). ```bash $ openstack endpoint create --region RegionOne \ metric internal http://controller:8041 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | c7009b1c2ee54b71b771fa3d0ae4f948 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 205978b411674e5a9990428f81d69384 | | service_name | gnocchi | | service_type | metric | ``` -------------------------------- ### Configure Ceilometer service credentials Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Configures service credentials for Ceilometer in the [service_credentials] section of /etc/ceilometer/ceilometer.conf. ```ini [service_credentials] ... auth_type = password auth_url = http://controller:5000/v3 project_domain_id = default user_domain_id = default project_name = service username = ceilometer password = CEILOMETER_PASS interface = internalURL region_name = RegionOne ``` -------------------------------- ### Add admin role to ceilometer user Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/install-base-ubuntu.md Adds the 'admin' role to the 'ceilometer' user for the 'service' project. ```bash $ openstack role add --project service --user ceilometer admin ``` -------------------------------- ### JSON response handler example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md Example of configuring the JSON response handler for dynamic pollsters. ```yaml --- - name: "dynamic.json.response" sample_type: "gauge" [...] response_handlers: ``` -------------------------------- ### Simple linked response example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md Example of a simple linked API response and its corresponding pollster configuration. ```json { "server_link": "http://test.com/v1/test-volumes/marker=c3", "servers": [ { "volume": [ { "name": "a", "tmp": "ra" } ], "id": 1, "name": "a1" }, { "volume": [ { "name": "b", "tmp": "rb" } ], "id": 2, "name": "b2" }, { "volume": [ { "name": "c", "tmp": "rc" } ], "id": 3, "name": "c3" } ] } ``` ```yaml --- - name: "dynamic.linked.response" sample_type: "gauge" unit: "request" value_attribute: "[volume].tmp" url_path: "v1/test-volumes" response_entries_key: "servers" next_sample_url_attribute: "server_link" ``` -------------------------------- ### Configure keystoneauth section in proxy-server.conf Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/swift/install-swift-ubuntu.md Add the ResellerAdmin role to the keystoneauth section in the swift proxy-server.conf file. ```ini [filter:keystoneauth] ... operator_roles = admin, user, ResellerAdmin ``` -------------------------------- ### Polling rule definition example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-data-collection.md Example of a polling.yaml file defining sources, intervals, meters, resources, and discovery. ```yaml --- sources: - name: 'source name' interval: 'how often the samples should be generated' meters: - 'meter filter' resources: - 'list of resource URLs' discovery: - 'list of discoverers' ``` -------------------------------- ### Example YAML for VPN connections data Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md An example configuration to gather VPN connections data, adapting to different statuses. ```yaml --- - name: "dynamic.network.services.vpn.connection" sample_type: "gauge" unit: "ipsec_site_connection" value_attribute: "status" endpoint_type: "network" url_path: "v2.0/vpn/ipsec-site-connections" metadata_fields: - "name" - "vpnservice_id" - "description" - "status" - "peer_address" value_mapping: ACTIVE: "1" metadata_mapping: name: "display_name" default_value: 0 ``` -------------------------------- ### Skip sample values example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md Example of skip_sample_values configuration for a dynamic pollster, defining values to ignore in the collected data. ```yaml skip_sample_values: - "CREATE_FAILED" - "DELETE_FAILED" ``` -------------------------------- ### Metadata fields example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md Example of metadata_fields configuration for a dynamic pollster, specifying which fields to retrieve from the component's response. ```yaml metadata_fields: - "labels" - "updated_at" - "keypair" - "master_flavor_id" - "api_address" - "master_addresses" - "node_count" - "docker_volume_size" - "master_count" - "node_addresses" - "status_reason" - "coe_version" - "cluster_template_id" - "name" - "stack_id" - "created_at" - "discovery_url" - "container_version" ``` -------------------------------- ### Complex linked response example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md Example of a complex linked API response (where the link is an object in a list) and its corresponding pollster configuration. ```json { "server_link": [ { "href": "http://test.com/v1/test-volumes/marker=c3", "rel": "next" }, { "href": "http://test.com/v1/test-volumes/marker=b1", "rel": "prev" } ], "servers": [ { "volume": [ { "name": "a", "tmp": "ra" } ], "id": 1, "name": "a1" }, { "volume": [ { "name": "b", "tmp": "rb" } ], "id": 2, "name": "b2" }, { "volume": [ { "name": "c", "tmp": "rc" } ], "id": 3, "name": "c3" } ] } ``` ```yaml --- - name: "dynamic.linked.response" sample_type: "gauge" unit: "request" value_attribute: "[volume].tmp" url_path: "v1/test-volumes" response_entries_key: "servers" next_sample_url_attribute: "server_link | filter(lambda v: v.get('rel') == 'next', value) | list(value) | value[0] | value.get('href')" ``` -------------------------------- ### Value mapping example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md Example of value_mapping configuration for a dynamic pollster, mapping raw values to specific values for backend storage. ```yaml value_mapping: CREATE_IN_PROGRESS: "0" CREATE_FAILED: "1" CREATE_COMPLETE: "2" UPDATE_IN_PROGRESS: "3" UPDATE_FAILED: "4" UPDATE_COMPLETE: "5" DELETE_IN_PROGRESS: "6" DELETE_FAILED: "7" DELETE_COMPLETE: "8" RESUME_COMPLETE: "9" RESUME_FAILED: "10" RESTORE_COMPLETE: "11" ROLLBACK_IN_PROGRESS: "12" ROLLBACK_FAILED: "13" ROLLBACK_COMPLETE: "14" SNAPSHOT_COMPLETE: "15" CHECK_COMPLETE: "16" ADOPT_COMPLETE: "17" ``` -------------------------------- ### RadosGW API JSON Response Example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md An example of a JSON response from the RadosGW API, illustrating the structure of user categories and summary data. ```json { "entries": [ { "buckets": [ { "bucket": "", "categories": [ { "bytes_received": 0, "bytes_sent": 40, "category": "list_buckets", "ops": 2, "successful_ops": 2 } ], "epoch": 1572969600, "owner": "user", "time": "2019-11-21 00:00:00.000000Z" }, { "bucket": "-", "categories": [ { "bytes_received": 0, "bytes_sent": 0, "category": "get_obj", "ops": 1, "successful_ops": 0 } ], "epoch": 1572969600, "owner": "someOtherUser", "time": "2019-11-21 00:00:00.000000Z" } ] } ] "summary": [ { "categories": [ { "bytes_received": 0, "bytes_sent": 0, "category": "create_bucket", "ops": 2, "successful_ops": 2 }, { "bytes_received": 0, "bytes_sent": 2120428, "category": "get_obj", "ops": 46, "successful_ops": 46 }, { "bytes_received": 0, "bytes_sent": 21484, "category": "list_bucket", "ops": 8, "successful_ops": 8 }, { "bytes_received": 6889056, "bytes_sent": 0, "category": "put_obj", "ops": 46, "successful_ops": 46 } ], "total": { "bytes_received": 6889056, "bytes_sent": 2141912, "ops": 102, "successful_ops": 102 }, "user": "user" }, { "categories": [ { "bytes_received": 0, "bytes_sent": 0, "category": "create_bucket", "ops": 1, "successful_ops": 1 }, { "bytes_received": 0, "bytes_sent": 0, "category": "delete_obj", "ops": 23, "successful_ops": 23 }, { "bytes_received": 0, "bytes_sent": 5371, "category": "list_bucket", "ops": 2, "successful_ops": 2 }, { "bytes_received": 3444350, "bytes_sent": 0, "category": "put_obj", "ops": 23, "successful_ops": 23 } ], "total": { "bytes_received": 3444350, "bytes_sent": 5371, "ops": 49, "successful_ops": 49 }, "user": "someOtherUser" } ] } ``` -------------------------------- ### Create ResellerAdmin role Source: https://github.com/openstack/ceilometer/blob/master/doc/source/install/swift/install-swift-ubuntu.md Create the ResellerAdmin role for Object Storage access. ```bash $ openstack role create ResellerAdmin +-----------+----------------------------------+ | Field | Value | +-----------+----------------------------------+ | domain_id | None | | id | 462fa46c13fd4798a95a3bfbe27b5e54 | | name | ResellerAdmin | +-----------+----------------------------------+ ``` -------------------------------- ### Metadata mapping example Source: https://github.com/openstack/ceilometer/blob/master/doc/source/admin/telemetry-dynamic-pollster.md Example of metadata_mapping configuration for a dynamic pollster, used to create new metadata fields from existing response data. ```yaml metadata_mapping: name: "display_name" some_attribute: "new_attribute_name" ``` -------------------------------- ### Running Unit Tests with tox Source: https://github.com/openstack/ceilometer/blob/master/HACKING.rst Examples of how to run unit tests using tox with different log capture and debug settings. ```bash tox -e py3 ``` ```bash OS_LOG_CAPTURE=1 OS_DEBUG=True tox -e py3 ``` ```bash OS_LOG_CAPTURE=1 tox -e py3 ``` ```bash tox -e py3 ```