From 470b898f1602de42657d981625f515703a194f59 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Wed, 15 Apr 2020 14:08:57 -0400 Subject: [PATCH] add docs Change-Id: Id0daef4fe2c7bad13312b2c1e41b7364403fd18c --- .gitignore | 2 ++ .zuul.yaml | 2 ++ doc/requirements.txt | 2 ++ doc/source/conf.py | 3 +++ doc/source/index.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ tox.ini | 10 ++++++++++ 6 files changed, 63 insertions(+) create mode 100644 .gitignore create mode 100644 doc/requirements.txt create mode 100644 doc/source/conf.py create mode 100644 doc/source/index.rst create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f213bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.tox +doc/build diff --git a/.zuul.yaml b/.zuul.yaml index f1a136e..6bad5fa 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -25,6 +25,8 @@ git_mirror_repository: vexxhost/libvirtd_exporter - project: + templates: + - publish-opendev-tox-docs check: jobs: - golangci-lint diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..af0b462 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,2 @@ +doc8 +sphinx diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 0000000..8f62d25 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,3 @@ +project = 'libvirtd Exporter' +copyright = '2020, VEXXHOST, Inc.' +author = 'VEXXHOST, Inc.' diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 0000000..124e90f --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,44 @@ +Prometheus exporter for ``libvirtd`` +==================================== +Prometheus exporter for Libvirt metrics, currently exposing domain stats +at the moment but with the ability for pluggable metric collectors. + + +Building +-------- +You can build the project yourself locally simply by running the following +inside the root folder. You'll need to make sure that you have the headers +for ``libvirtd`` installed on your machine. The following example is for +a Debian based machine. + +.. code-block:: bash + + apt-get -y install libvirt-dev + go build + + +Usage +----- +There are a few different ways that you can choose to deploy this exporter, +it's up to you to choose which one you prefer. + +Docker +~~~~~~ +``vexxhost/libvirtd_exporter:latest`` always points at the latest tested +commit which is always gated so it should not break and you can rely on +deploying it. When running with Docker, you'll need to mount the ``libvirt`` +socket into the container, preferebly the read-only one. + + +Contributing +------------ + +Running Locally +~~~~~~~~~~~~~~~ +There are scenarios where you need to iterate on the code lcoally but run it +against a remote hypervisor. It's possible to do this over SSH, an example +of how to do this against a CentOS host with ``libvirtd`` is: + +.. code-block:: bash + + go run libvirtd_exporter.go --libvirt.uri="qemu+ssh://root@remote-system/system?socket=/var/run/libvirt/libvirt-sock-ro" diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..b75ece9 --- /dev/null +++ b/tox.ini @@ -0,0 +1,10 @@ +[tox] +minversion = 2.0 +skipsdist = True + +[testenv:docs] +deps = + -r{toxinidir}/doc/requirements.txt +commands = + doc8 doc/source + sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html