diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index aadc1e95d9..66700c0b4b 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -607,6 +607,7 @@ enable_barbican: "no" enable_blazar: "no" enable_ceilometer: "no" enable_ceilometer_ipmi: "no" +enable_ceilometer_prometheus_pushgateway: "no" enable_cells: "no" enable_central_logging: "no" enable_ceph_rgw: "no" diff --git a/ansible/roles/ceilometer/defaults/main.yml b/ansible/roles/ceilometer/defaults/main.yml index e8f3a3a818..6e06a290b0 100644 --- a/ansible/roles/ceilometer/defaults/main.yml +++ b/ansible/roles/ceilometer/defaults/main.yml @@ -184,6 +184,12 @@ ceilometer_ks_users: # Backend #################### -ceilometer_database_type: "gnocchi" +ceilometer_database_type: "{{ 'gnocchi' if (enable_gnocchi | bool) else '' }}" ceilometer_upgrade_params: "" + +#################### +# Pushgateway +#################### +ceilometer_prometheus_pushgateway_host: "127.0.0.1" +ceilometer_prometheus_pushgateway_port: "9091" diff --git a/ansible/roles/ceilometer/tasks/precheck.yml b/ansible/roles/ceilometer/tasks/precheck.yml index dd5d430ee6..96240ca94d 100644 --- a/ansible/roles/ceilometer/tasks/precheck.yml +++ b/ansible/roles/ceilometer/tasks/precheck.yml @@ -12,4 +12,4 @@ changed_when: false when: - enable_ceilometer | bool - - not enable_gnocchi | bool + - not (enable_gnocchi | bool or enable_ceilometer_prometheus_pushgateway | bool) diff --git a/ansible/roles/ceilometer/templates/pipeline.yaml.j2 b/ansible/roles/ceilometer/templates/pipeline.yaml.j2 index 452bbdbbab..b215e364f9 100644 --- a/ansible/roles/ceilometer/templates/pipeline.yaml.j2 +++ b/ansible/roles/ceilometer/templates/pipeline.yaml.j2 @@ -8,4 +8,9 @@ sources: sinks: - name: meter_sink publishers: +{% if enable_gnocchi | bool %} - gnocchi:// +{% endif %} +{% if enable_ceilometer_prometheus_pushgateway | bool %} + - prometheus://{{ ceilometer_prometheus_pushgateway_host }}:{{ ceilometer_prometheus_pushgateway_port }}/metrics/job/openstack-telemetry +{% endif %} diff --git a/releasenotes/notes/bug-1964135-383c8bf4fad16618.yaml b/releasenotes/notes/bug-1964135-383c8bf4fad16618.yaml new file mode 100644 index 0000000000..9d943f7554 --- /dev/null +++ b/releasenotes/notes/bug-1964135-383c8bf4fad16618.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Adds the ability to use Prometheus as the metrics database for Ceilometer. + + Adapts Ceilometer configurations so metrics can be pushed to a Prometheus + Pushgateway. + `LP#1964135 `__