Skip to content

Commit

Permalink
Use Nova API 2.79 in openstack-exporter queries
Browse files Browse the repository at this point in the history
Nova API version 2.88 removed details from the os-hypervisors API [1].
These details are queried by openstack-exporter for metrics such as
openstack_nova_running_vms. However, a change between v1.3.0 and v1.4.0
of the exporter caused it to use the latest API version, breaking
collection of these metrics [2].

Starting from v1.5.0 of the exporter, OS_COMPUTE_API_VERSION can be set
to configure the Nova API version to be used. Set it to 2.79 (maximum in
Train), which also fixes an issue displaying the flavor ID [4].

[1] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#maximum-in-wallaby
[2] openstack-exporter/openstack-exporter#191
[3] openstack-exporter/openstack-exporter#201
[4] openstack-exporter/openstack-exporter#220

Change-Id: I7605a3f9f74effb29ecec3b28e4709fd5f7f8cd4
  • Loading branch information
priteau committed Jun 16, 2022
1 parent 92f8e93 commit 187db36
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ prometheus_elasticsearch_exporter_interval: "{{ prometheus_scrape_interval }}"
prometheus_cmdline_extras:
prometheus_ceph_mgr_exporter_endpoints: []
prometheus_openstack_exporter_endpoint_type: "internal"
prometheus_openstack_exporter_compute_api_version: "2.79"
prometheus_libvirt_exporter_interval: "60s"

############
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/prometheus/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ prometheus_services:
container_name: "prometheus_openstack_exporter"
group: "prometheus-openstack-exporter"
enabled: "{{ enable_prometheus_openstack_exporter | bool }}"
environment:
OS_COMPUTE_API_VERSION: "{{ prometheus_openstack_exporter_compute_api_version }}"
image: "{{ prometheus_openstack_exporter_image_full }}"
volumes: "{{ prometheus_openstack_exporter_default_volumes + prometheus_openstack_exporter_extra_volumes }}"
dimensions: "{{ prometheus_openstack_exporter_dimensions }}"
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/prometheus/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
environment: "{{ service.environment|default(omit) }}"
when:
- kolla_action != "config"

Expand Down
1 change: 1 addition & 0 deletions ansible/roles/prometheus/tasks/check-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
pid_mode: "{{ item.value.pid_mode|default('') }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment|default(omit) }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
features:
- |
Adds support for configuring the Nova API microversion used by the
OpenStack exporter for Prometheus using the
``prometheus_openstack_exporter_compute_api_version`` variable. Its default
value is ``2.79`` to keep some metrics which became unavailable in
`microversion 2.88
<https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#maximum-in-wallaby>`__.
upgrade:
- |
Some metrics provided by the OpenStack exporter for Prometheus may change
or become unavailable based on the API microversion being used.

0 comments on commit 187db36

Please sign in to comment.