From 7cae041f46b010694c6c40b31e36719af1f3fb26 Mon Sep 17 00:00:00 2001 From: Zac Dover Date: Mon, 26 May 2025 09:52:17 +1000 Subject: [PATCH] doc/mgr: edit prometheus.rst Edit doc/mgr/prometheus.rst. This is part of a project to separate out the twenty-five files that were committed to https://github.com/ceph/ceph/pull/62782. Signed-off-by: Zac Dover --- doc/mgr/prometheus.rst | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/doc/mgr/prometheus.rst b/doc/mgr/prometheus.rst index e61b7beb4c33f..276f00c314653 100644 --- a/doc/mgr/prometheus.rst +++ b/doc/mgr/prometheus.rst @@ -20,7 +20,7 @@ Enabling Prometheus output Enable the ``prometheus`` module by running the below command : -.. prompt:: bash $ +.. prompt:: bash # ceph mgr module enable prometheus @@ -50,9 +50,9 @@ configurable with ``ceph config set``, with keys is registered with Prometheus's `registry `_. -.. 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:: @@ -70,7 +70,7 @@ might be useful to increase the scrape interval. 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 @@ -93,13 +93,13 @@ set`` commands. To configure the module to respond with possibly stale data, set the cache strategy 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 configure 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 @@ -113,7 +113,7 @@ If you are using the ``prometheus`` module behind a reverse proxy or load balancer, you can simplify discovery of the active instance by switching to ``error``-mode: -.. prompt:: bash $ +.. prompt:: bash # ceph config set mgr mgr/prometheus/standby_behaviour error @@ -121,7 +121,7 @@ If set, the ``prometheus`` module will respond with a HTTP error when requesting 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 @@ -129,7 +129,7 @@ Valid error codes are between 400-599. 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 @@ -154,17 +154,20 @@ The metrics take the following form: The health check history may be retrieved and cleared by running the following commands: -:: +.. prompt:: bash # - ceph healthcheck history ls [--format {plain|json|json-pretty}] - ceph healthcheck history clear + ceph healthcheck history ls [--format {plain|json|json-pretty}] + ceph healthcheck history clear The ``ceph healthcheck ls`` command provides an overview of the health checks that the cluster has encountered since the last ``clear`` command was issued: +.. 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 @@ -184,13 +187,13 @@ statistics are collected for all namespaces in the pool. To enable collection of stats for RBD pools named ``pool1``, ``pool2`` and ``poolN``: -.. prompt:: bash $ +.. prompt:: bash # ceph config set mgr mgr/prometheus/rbd_stats_pools "pool1,pool2,poolN" A wildcard can be used to indicate all pools or namespaces: -.. prompt:: bash $ +.. prompt:: bash # ceph config set mgr mgr/prometheus/rbd_stats_pools "*" @@ -203,7 +206,7 @@ RBD image. To set the sync interval to 10 minutes run the following command: -.. prompt:: bash $ +.. prompt:: bash # ceph config set mgr mgr/prometheus/rbd_stats_pools_refresh_interval 600 @@ -214,7 +217,7 @@ With the introduction of the ``ceph-exporter`` daemon, the ``prometheus`` module 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 -- 2.39.5