Skip to content

Commit

Permalink
Merge "Add Prometheus libvirt exporter image" into stable/xena
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Mar 15, 2022
2 parents a96df11 + 2b605d3 commit ebb2b09
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docker/prometheus/prometheus-libvirt-exporter/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM {{ namespace }}/{{ infra_image_prefix }}prometheus-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% import "macros.j2" as macros with context %}

{% block prometheus_libvirt_exporter_header %}{% endblock %}

{% if base_package_type == 'rpm' %}
{% set prometheus_libvirt_exporter_packages = [
'git',
'go',
'libvirt-devel',
] %}
{% elif base_package_type == 'deb' %}
{% set prometheus_libvirt_exporter_packages = [
'build-essential',
'git',
'golang-go',
'libvirt-dev',
'pkg-config',
] %}
{% endif %}

{{ macros.install_packages(prometheus_libvirt_exporter_packages | customizable("packages")) }}

{% block prometheus_libvirt_exporter_version %}
ARG prometheus_libvirt_exporter_version=2.3.0
ARG prometheus_libvirt_exporter_path=github.com/AlexZzz/libvirt-exporter
{% endblock %}

{% block prometheus_libvirt_exporter_install %}
ENV GOPATH=/build
RUN go mod init libvirt-exporter \
&& go get -v ${prometheus_libvirt_exporter_path}@${prometheus_libvirt_exporter_version} \
&& mv /build/bin/libvirt-exporter /opt \
&& rm -rf /build

{% endblock %}

{% block prometheus_libvirt_exporter_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER root
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
features:
- Added a container image for Prometheus libvirt exporter, to be used
for monitoring deployments which provide VMs with libvirt.

0 comments on commit ebb2b09

Please sign in to comment.