prometheus-salt-exporter


Nameprometheus-salt-exporter JSON
Version 0.1.4 PyPI version JSON
download
home_pagehttps://github.com/ioki-mobility/salt_exporter
SummaryPrometheus Exporter for Salt highstate metrics run from the Salt master.
upload_time2023-03-31 09:02:59
maintainer
docs_urlNone
authorioki SRE core
requires_python>=3.8
licenseMIT
keywords prometheus exporter salt monitoring
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            prometheus-salt-exporter
========================

Prometheus Exporter for Salt highstate metrics run from the Salt master.
The exporter must have permissions to execute commands locally.

Note: Python 2 is not supported. Instead use Python 3.8 or higher.

Inspired by `BonnierNews/saltstack_exporter <https://github.com/BonnierNews/saltstack_exporter>`__

Prerequisites
-------------

-  Install
   `salt <https://docs.saltproject.io/salt/install-guide/en/latest/>`__
-  Be on the salt master node

Installation
------------

.. code:: shell

   pip install prometheus-salt-exporter

Configuration and Usage
-----------------------

::

   usage: prometheus_salt_exporter [-h] [--listen-addr LISTEN_ADDR] [--listen-port LISTEN_PORT] [--highstate-interval HIGHSTATE_INTERVAL] [--wait-on-error-interval WAIT_ON_ERROR_INTERVAL]
                  [--batch-size BATCH_SIZE] [--salt-target SALT_TARGET] [--log-level LOG_LEVEL]

   options:
   -h, --help            show this help message and exit
   --listen-addr LISTEN_ADDR
                           Address to bind to. IPv4 and IPv6 addresses can be specified. (default: ::)
   --listen-port LISTEN_PORT
                           Port to bind to (default: 9175)
   --highstate-interval HIGHSTATE_INTERVAL
                           Seconds between each highstate test run (default: 300)
   --wait-on-error-interval WAIT_ON_ERROR_INTERVAL
                           Seconds to wait when an error occurs (e.g. salt-master not responding in time) (default: 300)
   --batch-size BATCH_SIZE
                           Batch size to use in salt (default: 10)
   --batch-wait BATCH_WAIT
                           Seconds to wait after a minion returns, before sending the command to a new minion (default: 10)
   --salt-target SALT_TARGET
                           Salt target to be used (default: *)
   --log-level LOG_LEVEL
                           log level (default: 30)

Metrics
-------

Currently, the exporter exposes metrics for highstate conformity only:

+---------------------------+---------------------------------------------+
| Metric                    | Description                                 |
+===========================+=============================================+
|| saltstack_states_total   || Number of states which apply to the minion |
||                          || in highstate                               |
+---------------------------+---------------------------------------------+
|| saltstack_nonhigh_states || Number of states which would change on     |
||                          || state.highstate                            |
+---------------------------+---------------------------------------------+
|| saltstack_error_states   || Number of states which returns an error on |
||                          || highstate dry-run                          |
+---------------------------+---------------------------------------------+
| saltstack_highstate_error | Error in trying to apply highstate          |
+---------------------------+---------------------------------------------+
|| saltstack_last_highstate || Timestamp of the last highstate test run   |
||                          ||                                            |
+---------------------------+---------------------------------------------+

Output
------

::

   # HELP saltstack_last_highstate_total Timestamp of the last highstate test run
   # TYPE saltstack_last_highstate_total counter
   saltstack_last_highstate_total 1.674730426e+09
   # HELP saltstack_states_total Number of states which apply to the minion in highstate
   # TYPE saltstack_states_total gauge
   saltstack_states_total{minion="1.minion"} 271.0
   # HELP saltstack_nonhigh_states Number of states which would change on state.highstate
   # TYPE saltstack_nonhigh_states gauge
   saltstack_nonhigh_states{minion="1.minion"} 13.0
   # HELP saltstack_error_states Number of states which returns an error on highstate dry-run
   # TYPE saltstack_error_states gauge
   saltstack_error_states{minion="1.minion"} 0.0
   # HELP saltstack_highstate_error Error in trying to apply highstate
   # TYPE saltstack_highstate_error gauge
   saltstack_highstate_error{minion="1.minion"} 0.0
   # HELP saltstack_states_total Number of states which apply to the minion in highstate
   # TYPE saltstack_states_total gauge
   saltstack_states_total{minion="2.minion"} 197.0
   # HELP saltstack_nonhigh_states Number of states which would change on state.highstate
   # TYPE saltstack_nonhigh_states gauge
   saltstack_nonhigh_states{minion="2.minion"} 6.0
   # HELP saltstack_error_states Number of states which returns an error on highstate dry-run
   # TYPE saltstack_error_states gauge
   saltstack_error_states{minion="2.minion"} 0.0
   # HELP saltstack_highstate_error Error in trying to apply highstate
   # TYPE saltstack_highstate_error gauge
   saltstack_highstate_error{minion="2.minion"} 0.0


Troubleshooting
---------------

Resource issues
^^^^^^^^^^^^^^^

If you encounter resource issues (e.g. your ``salt-master`` cannot keep up with providing the highstate), 
please consider using a combination of ``--batch-wait`` and ``--batch-size`` by decreasing the batch size and increasing 
the waiting time between requests. 



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ioki-mobility/salt_exporter",
    "name": "prometheus-salt-exporter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "prometheus exporter salt monitoring",
    "author": "ioki SRE core",
    "author_email": "sre.core@ioki.com",
    "download_url": "https://files.pythonhosted.org/packages/ea/ca/a32b15d8f1cc10cff95b75e044f7716a959bb4a05991718c6b12370598af/prometheus-salt-exporter-0.1.4.tar.gz",
    "platform": null,
    "description": "prometheus-salt-exporter\n========================\n\nPrometheus Exporter for Salt highstate metrics run from the Salt master.\nThe exporter must have permissions to execute commands locally.\n\nNote: Python 2 is not supported. Instead use Python 3.8 or higher.\n\nInspired by `BonnierNews/saltstack_exporter <https://github.com/BonnierNews/saltstack_exporter>`__\n\nPrerequisites\n-------------\n\n-  Install\n   `salt <https://docs.saltproject.io/salt/install-guide/en/latest/>`__\n-  Be on the salt master node\n\nInstallation\n------------\n\n.. code:: shell\n\n   pip install prometheus-salt-exporter\n\nConfiguration and Usage\n-----------------------\n\n::\n\n   usage: prometheus_salt_exporter [-h] [--listen-addr LISTEN_ADDR] [--listen-port LISTEN_PORT] [--highstate-interval HIGHSTATE_INTERVAL] [--wait-on-error-interval WAIT_ON_ERROR_INTERVAL]\n                  [--batch-size BATCH_SIZE] [--salt-target SALT_TARGET] [--log-level LOG_LEVEL]\n\n   options:\n   -h, --help            show this help message and exit\n   --listen-addr LISTEN_ADDR\n                           Address to bind to. IPv4 and IPv6 addresses can be specified. (default: ::)\n   --listen-port LISTEN_PORT\n                           Port to bind to (default: 9175)\n   --highstate-interval HIGHSTATE_INTERVAL\n                           Seconds between each highstate test run (default: 300)\n   --wait-on-error-interval WAIT_ON_ERROR_INTERVAL\n                           Seconds to wait when an error occurs (e.g. salt-master not responding in time) (default: 300)\n   --batch-size BATCH_SIZE\n                           Batch size to use in salt (default: 10)\n   --batch-wait BATCH_WAIT\n                           Seconds to wait after a minion returns, before sending the command to a new minion (default: 10)\n   --salt-target SALT_TARGET\n                           Salt target to be used (default: *)\n   --log-level LOG_LEVEL\n                           log level (default: 30)\n\nMetrics\n-------\n\nCurrently, the exporter exposes metrics for highstate conformity only:\n\n+---------------------------+---------------------------------------------+\n| Metric                    | Description                                 |\n+===========================+=============================================+\n|| saltstack_states_total   || Number of states which apply to the minion |\n||                          || in highstate                               |\n+---------------------------+---------------------------------------------+\n|| saltstack_nonhigh_states || Number of states which would change on     |\n||                          || state.highstate                            |\n+---------------------------+---------------------------------------------+\n|| saltstack_error_states   || Number of states which returns an error on |\n||                          || highstate dry-run                          |\n+---------------------------+---------------------------------------------+\n| saltstack_highstate_error | Error in trying to apply highstate          |\n+---------------------------+---------------------------------------------+\n|| saltstack_last_highstate || Timestamp of the last highstate test run   |\n||                          ||                                            |\n+---------------------------+---------------------------------------------+\n\nOutput\n------\n\n::\n\n   # HELP saltstack_last_highstate_total Timestamp of the last highstate test run\n   # TYPE saltstack_last_highstate_total counter\n   saltstack_last_highstate_total 1.674730426e+09\n   # HELP saltstack_states_total Number of states which apply to the minion in highstate\n   # TYPE saltstack_states_total gauge\n   saltstack_states_total{minion=\"1.minion\"} 271.0\n   # HELP saltstack_nonhigh_states Number of states which would change on state.highstate\n   # TYPE saltstack_nonhigh_states gauge\n   saltstack_nonhigh_states{minion=\"1.minion\"} 13.0\n   # HELP saltstack_error_states Number of states which returns an error on highstate dry-run\n   # TYPE saltstack_error_states gauge\n   saltstack_error_states{minion=\"1.minion\"} 0.0\n   # HELP saltstack_highstate_error Error in trying to apply highstate\n   # TYPE saltstack_highstate_error gauge\n   saltstack_highstate_error{minion=\"1.minion\"} 0.0\n   # HELP saltstack_states_total Number of states which apply to the minion in highstate\n   # TYPE saltstack_states_total gauge\n   saltstack_states_total{minion=\"2.minion\"} 197.0\n   # HELP saltstack_nonhigh_states Number of states which would change on state.highstate\n   # TYPE saltstack_nonhigh_states gauge\n   saltstack_nonhigh_states{minion=\"2.minion\"} 6.0\n   # HELP saltstack_error_states Number of states which returns an error on highstate dry-run\n   # TYPE saltstack_error_states gauge\n   saltstack_error_states{minion=\"2.minion\"} 0.0\n   # HELP saltstack_highstate_error Error in trying to apply highstate\n   # TYPE saltstack_highstate_error gauge\n   saltstack_highstate_error{minion=\"2.minion\"} 0.0\n\n\nTroubleshooting\n---------------\n\nResource issues\n^^^^^^^^^^^^^^^\n\nIf you encounter resource issues (e.g. your ``salt-master`` cannot keep up with providing the highstate), \nplease consider using a combination of ``--batch-wait`` and ``--batch-size`` by decreasing the batch size and increasing \nthe waiting time between requests. \n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Prometheus Exporter for Salt highstate metrics run from the Salt master.",
    "version": "0.1.4",
    "split_keywords": [
        "prometheus",
        "exporter",
        "salt",
        "monitoring"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "342b3d79e2d4ed3395061ddb90c7c8879f8095eb077cb960872c46047139b7b9",
                "md5": "5f2a002d0239f9e99c5baa87e81dd4f4",
                "sha256": "c5ce46bb2911c6f0596de8405cf0df8d2e275631014701c6955a57403b652b17"
            },
            "downloads": -1,
            "filename": "prometheus_salt_exporter-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5f2a002d0239f9e99c5baa87e81dd4f4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7584,
            "upload_time": "2023-03-31T09:02:58",
            "upload_time_iso_8601": "2023-03-31T09:02:58.278139Z",
            "url": "https://files.pythonhosted.org/packages/34/2b/3d79e2d4ed3395061ddb90c7c8879f8095eb077cb960872c46047139b7b9/prometheus_salt_exporter-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eacaa32b15d8f1cc10cff95b75e044f7716a959bb4a05991718c6b12370598af",
                "md5": "c89411d7bfe7765c9f4b1f63b21a7d14",
                "sha256": "86d0270b87b2fd7c09a0d6c73edc9e2ee3ac0a88753ea4bdde169ddb0baa3cf7"
            },
            "downloads": -1,
            "filename": "prometheus-salt-exporter-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "c89411d7bfe7765c9f4b1f63b21a7d14",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7366,
            "upload_time": "2023-03-31T09:02:59",
            "upload_time_iso_8601": "2023-03-31T09:02:59.964632Z",
            "url": "https://files.pythonhosted.org/packages/ea/ca/a32b15d8f1cc10cff95b75e044f7716a959bb4a05991718c6b12370598af/prometheus-salt-exporter-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-31 09:02:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ioki-mobility",
    "github_project": "salt_exporter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "prometheus-salt-exporter"
}
        
Elapsed time: 0.05273s