diff --git a/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 b/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 index d597780a6a..aa844cfb01 100644 --- a/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 +++ b/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 @@ -89,6 +89,19 @@ auth_section = keystone_authtoken region_name = {{ openstack_region_name }} {% endif %} +{% if cloudkitty_fetcher_backend == "prometheus" %} +[fetcher_prometheus] +metric = openstack_identity_project_info +scope_attribute = id +prometheus_url = {{ cloudkitty_prometheus_url }} + +{% if cloudkitty_prometheus_cafile is defined %} +cafile = {{ cloudkitty_prometheus_cafile }} +{% endif %} + +insecure = {{ cloudkitty_prometheus_insecure_connections }} +{% endif %} + [api] host_ip = {{ api_interface_address }} port = {{ cloudkitty_api_port }} diff --git a/doc/source/reference/rating/cloudkitty-guide.rst b/doc/source/reference/rating/cloudkitty-guide.rst index df5f79aa35..a95ea6c1ba 100644 --- a/doc/source/reference/rating/cloudkitty-guide.rst +++ b/doc/source/reference/rating/cloudkitty-guide.rst @@ -59,7 +59,11 @@ CloudKitty natively supports multiple fetcher backends. By default Kolla Ansible uses the ``keystone`` backend. This can be changed using the ``cloudkitty_fetcher_backend`` option. -You will need to provide extra configuration for non-default fetchers in +Kolla Ansible also supports the ``prometheus`` backend type, which is +configured to discover scopes from the ``id`` label of the +``openstack_identity_project_info`` metric of OpenStack exporter. + +You will need to provide extra configuration for unsupported fetchers in ``/etc/kolla/config/cloudkitty.conf``. Cloudkitty Storage Backend