The *prometheus* module is enabled with:
-.. prompt:: bash $
+.. prompt:: bash #
ceph mgr module enable prometheus
is registered with Prometheus's `registry
<https://github.com/prometheus/prometheus/wiki/Default-port-allocations>`_.
-.. prompt:: bash $
+.. prompt:: bash #
- ceph config set mgr mgr/prometheus/server_addr 0.0.0.
+ ceph config set mgr mgr/prometheus/server_addr 0.0.0.0
ceph config set mgr mgr/prometheus/server_port 9283
.. warning::
To set a different scrape interval in the Prometheus module, set
``scrape_interval`` to the desired value:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/scrape_interval 20
To tell the module to respond with possibly stale data, set it to ``return``:
-.. prompt:: bash $
+.. prompt:: bash #
- ceph config set mgr mgr/prometheus/stale_cache_strategy return
+ ceph config set mgr mgr/prometheus/stale_cache_strategy return
To tell the module to respond with "service unavailable", set it to ``fail``:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/stale_cache_strategy fail
loadbalancer, you can simplify discovering the active instance by switching
to ``error``-mode:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/standby_behaviour error
from the standby instance. The default error code is 500, but you can configure
the HTTP response code with:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/standby_error_status_code 503
To switch back to the default behaviour, simply set the config key to ``default``:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/standby_behaviour default
The health check history is made available through the following commands;
-::
+.. prompt:: bash #
- healthcheck history ls [--format {plain|json|json-pretty}]
- healthcheck history clear
+ ceph healthcheck history ls [--format {plain|json|json-pretty}]
+ ceph healthcheck history clear
The ``ls`` command provides an overview of the health checks that the cluster has
encountered, or since the last ``clear`` command was issued. The example below;
+.. prompt:: bash #
+
+ ceph healthcheck history ls
+
::
- [ceph: root@c8-node1 /]# ceph healthcheck history ls
Healthcheck Name First Seen (UTC) Last seen (UTC) Count Active
OSDMAP_FLAGS 2021/09/16 03:17:47 2021/09/16 22:07:40 2 No
OSD_DOWN 2021/09/17 00:11:59 2021/09/17 00:11:59 1 Yes
Example to activate the RBD-enabled pools ``pool1``, ``pool2`` and ``poolN``:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/rbd_stats_pools "pool1,pool2,poolN"
The wildcard can be used to indicate all pools or namespaces:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/rbd_stats_pools "*"
Example to turn up the sync interval to 10 minutes:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/rbd_stats_pools_refresh_interval 600
perf counters as prometheus metrics by default. However, one may re-enable exporting these metrics by setting
the module option ``exclude_perf_counters`` to ``false``:
-.. prompt:: bash $
+.. prompt:: bash #
ceph config set mgr mgr/prometheus/exclude_perf_counters false