2019-04-24 18:18:10 +02:00
prometheus-formula
2020-05-14 01:27:23 +02:00
==================
Formula to manage Prometheus on GNU/Linux and MacOS.
2019-04-24 18:18:10 +02:00
|img_travis| |img_sr|
.. |img_travis| image :: https://travis-ci.com/saltstack-formulas/prometheus-formula.svg?branch=master
:alt: Travis CI Build Status
:scale: 100%
:target: https://travis-ci.com/saltstack-formulas/prometheus-formula
.. |img_sr| image :: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
:alt: Semantic Release
:scale: 100%
:target: https://github.com/semantic-release/semantic-release
2020-05-14 01:27:23 +02:00
2019-04-24 18:18:10 +02:00
.. contents :: **Table of Contents**
2020-05-14 01:27:23 +02:00
:depth: 1
2019-04-24 18:18:10 +02:00
General notes
-------------
See the full `SaltStack Formulas installation and usage instructions
2020-05-14 01:27:23 +02:00
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html> `_. If you are interested in writing or contributing to formulas, please pay attention to the ` Writing Formula Section
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas> `_. If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``, which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/> `_ . See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning> `_ for more details.
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
Special notes
-------------
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
None.
2019-04-24 18:18:10 +02:00
Contributing to this repo
-------------------------
2019-10-14 12:48:39 +02:00
**Commit message formatting is significant!!**
2021-05-05 16:21:09 +02:00
Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst> `_ for more details.
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
Available metastates
--------------------
2019-04-24 18:18:10 +02:00
.. contents ::
:local:
`` prometheus ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
*Meta-state (This is a state that includes other states)* .
2020-05-14 01:27:23 +02:00
This installs from prometheus solution.
2019-04-24 18:18:10 +02:00
2019-06-08 19:39:21 +02:00
`` prometheus.archive ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^
2019-06-08 19:39:21 +02:00
2020-05-14 01:27:23 +02:00
This state will install prometheus components on MacOS and GNU/Linux from archive.
2019-06-08 19:39:21 +02:00
2020-05-14 01:27:23 +02:00
`` prometheus.clientlibs ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^^^^
2019-06-22 19:24:19 +02:00
2020-05-14 01:27:23 +02:00
This state will install prometheus client libraries on MacOS and GNU/Linux from archive.
2019-06-22 19:24:19 +02:00
2019-04-24 18:18:10 +02:00
`` prometheus.package ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
This state will install prometheus component packages from GNU/Linux.
2019-06-08 19:39:21 +02:00
2019-04-24 18:18:10 +02:00
`` prometheus.config ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
This state will apply prometheus service configuration (files).
2019-04-24 18:18:10 +02:00
`` prometheus.service ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
This state will start prometheus component services.
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
`` prometheus.exporters ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
This state will apply prometheus exporters configuration.
`` prometheus.exporters.clean ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
This state will remove prometheus exporters configuration.
2019-04-24 18:18:10 +02:00
`` prometheus.service.clean ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
This state will stop prometheus component services.
2019-04-24 18:18:10 +02:00
`` prometheus.config.clean ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
This state will remove prometheus service configuration (files).
2019-04-24 18:18:10 +02:00
`` prometheus.package.clean ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
This state will uninstall prometheus component packages from GNU/Linux.
2019-04-24 18:18:10 +02:00
2020-05-14 01:27:23 +02:00
`` prometheus.clientlibs.clean ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-06-08 19:39:21 +02:00
2020-05-14 01:27:23 +02:00
This state will uninstall prometheus client libraries.
2019-06-08 19:39:21 +02:00
2020-05-14 01:27:23 +02:00
`` prometheus.archive.clean ``
2021-05-05 16:21:09 +02:00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-06-22 19:24:19 +02:00
2020-05-14 01:27:23 +02:00
This state will remove prometheus component archive (directories).
2019-06-22 19:24:19 +02:00
2019-06-08 19:39:21 +02:00
2020-05-14 01:27:23 +02:00
Testing
-------
Linux testing is done with `` kitchen-salt `` .
Requirements
^^^^^^^^^^^^
* Ruby
* Docker
.. code-block :: bash
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]
Where `` [platform] `` is the platform name defined in `` kitchen.yml `` ,
e.g. `` debian-9-2019-2-py3 `` .
`` bin/kitchen converge ``
^^^^^^^^^^^^^^^^^^^^^^^^
Creates the docker instance and runs the `` prometheus `` main state, ready for testing.
`` bin/kitchen verify ``
^^^^^^^^^^^^^^^^^^^^^^
Runs the `` inspec `` tests on the actual instance.
`` bin/kitchen destroy ``
^^^^^^^^^^^^^^^^^^^^^^^
Removes the docker instance.
`` bin/kitchen test ``
^^^^^^^^^^^^^^^^^^^^
Runs all of the stages above in one go: i.e. `` destroy `` + `` converge `` + `` verify `` + `` destroy `` .
`` bin/kitchen login ``
^^^^^^^^^^^^^^^^^^^^^
2019-10-04 01:16:27 +02:00
2020-05-14 01:27:23 +02:00
Gives you SSH access to the instance for manual testing.
2019-10-04 01:16:27 +02:00