diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 286bd56b30..9544c2d568 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -605,6 +605,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 3a7fa76e7b..6bc75b3a5e 100644 --- a/ansible/roles/ceilometer/defaults/main.yml +++ b/ansible/roles/ceilometer/defaults/main.yml @@ -182,6 +182,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 `__