diff options
| author | Doug Szumski <doug@stackhpc.com> | 2025-06-06 17:18:23 +0100 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2026-04-13 09:51:28 +0200 |
| commit | e0dbeffb85126796cb6ece6ae755587d42a808a9 (patch) | |
| tree | 07a9dbcef23904c0c6fea44a832ae8a3ceec811f | |
| parent | 8b88c9eb5ea58b255e47489ab47e3e7dccda0c55 (diff) | |
| download | kolla-e0dbeffb85126796cb6ece6ae755587d42a808a9.tar.gz kolla-e0dbeffb85126796cb6ece6ae755587d42a808a9.zip | |
Add Prometheus network exporter
This exporter comes from https://github.com/openstack-k8s-operators
and will replace the existing OVN exporter which was archived at the
end of 2024.
It can gather metrics from both OVN and OVS based OpenStack clouds.
Change-Id: Idb070d5e5469abd472481f7e19614ee2a78c85d0
Signed-off-by: Doug Szumski <doug@stackhpc.com>
| -rw-r--r-- | docker/prometheus/prometheus-openstack-network-exporter/Dockerfile.j2 | 45 | ||||
| -rw-r--r-- | kolla/common/sources.py | 6 | ||||
| -rw-r--r-- | releasenotes/notes/add-openstack-network-exporter-fd37c9bbe2fe387d.yaml | 5 |
3 files changed, 56 insertions, 0 deletions
diff --git a/docker/prometheus/prometheus-openstack-network-exporter/Dockerfile.j2 b/docker/prometheus/prometheus-openstack-network-exporter/Dockerfile.j2 new file mode 100644 index 000000000..389f7c618 --- /dev/null +++ b/docker/prometheus/prometheus-openstack-network-exporter/Dockerfile.j2 @@ -0,0 +1,45 @@ +FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }} AS build-stage + +{% import "macros.j2" as macros with context %} + +{% if base_package_type == 'rpm' %} + + {% set prometheus_openstack_network_exporter_build_packages = [ + 'golang', + 'make', + ] %} + +{% elif base_package_type == 'deb' %} + + {% set prometheus_openstack_network_exporter_build_packages = [ + 'golang', + 'make', + ] %} + +{% endif %} + +{{ macros.install_packages(prometheus_openstack_network_exporter_build_packages | customizable("packages")) }} + +ADD prometheus-openstack-network-exporter-archive / + +RUN cd openstack-network-exporter* && make + +FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }} AS final-stage +{% block labels %} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" +{% endblock %} + +{% block prometheus_openstack_network_exporter_header %}{% endblock %} + +{% block prometheus_openstack_network_exporter_install %} +RUN mkdir /opt/openstack-network-exporter +COPY --from=build-stage /openstack-network-exporter*/dataplane-node-exporter /opt/openstack-network-exporter/ +{% endblock %} + +{{ macros.kolla_patch_sources() }} + +{% block prometheus_openstack_network_exporter_footer %}{% endblock %} +{% block footer %}{% endblock %} + +# NOTE: OVN/OVS are running as root. Since we need to read sockets owned by +# these services we don't switch to the Prometheus user here. diff --git a/kolla/common/sources.py b/kolla/common/sources.py index 24a0d7851..9e2e53874 100644 --- a/kolla/common/sources.py +++ b/kolla/common/sources.py @@ -384,6 +384,12 @@ SOURCES = { 'releases/download/v${version}/' 'openstack-exporter' '_${version}_linux_${debian_arch}.tar.gz')}, + 'prometheus-openstack-network-exporter': { + 'version': '0.0.2', + 'type': 'url', + 'location': ('https://github.com/' + 'openstack-k8s-operators/openstack-network-exporter/' + 'archive/v${version}.tar.gz')}, 'prometheus-server': { 'version': '3.5.1', 'type': 'url', diff --git a/releasenotes/notes/add-openstack-network-exporter-fd37c9bbe2fe387d.yaml b/releasenotes/notes/add-openstack-network-exporter-fd37c9bbe2fe387d.yaml new file mode 100644 index 000000000..6e9692ea4 --- /dev/null +++ b/releasenotes/notes/add-openstack-network-exporter-fd37c9bbe2fe387d.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds a Prometheus network exporter which can collect + metrics from both OVN and OVS based deployments. |
