Skip to content

Commit e91b06a

Browse files
authored
Merge pull request ceph#63471 from zdover23/wip-doc-2025-05-26-mgr-prometheus-62782-followup
doc/mgr: edit prometheus.rst Reviewed-by: Anthony D'Atri <[email protected]>
2 parents a0531e4 + 7cae041 commit e91b06a

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

doc/mgr/prometheus.rst

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Enabling Prometheus output
2020

2121
Enable the ``prometheus`` module by running the below command :
2222

23-
.. prompt:: bash $
23+
.. prompt:: bash #
2424

2525
ceph mgr module enable prometheus
2626

@@ -50,9 +50,9 @@ configurable with ``ceph config set``, with keys
5050
is registered with Prometheus's `registry
5151
<https://github.com/prometheus/prometheus/wiki/Default-port-allocations>`_.
5252

53-
.. prompt:: bash $
53+
.. prompt:: bash #
5454

55-
ceph config set mgr mgr/prometheus/server_addr 0.0.0.
55+
ceph config set mgr mgr/prometheus/server_addr 0.0.0.0
5656
ceph config set mgr mgr/prometheus/server_port 9283
5757

5858
.. warning::
@@ -70,7 +70,7 @@ might be useful to increase the scrape interval.
7070
To set a different scrape interval in the Prometheus module, set
7171
``scrape_interval`` to the desired value:
7272

73-
.. prompt:: bash $
73+
.. prompt:: bash #
7474

7575
ceph config set mgr mgr/prometheus/scrape_interval 20
7676

@@ -93,13 +93,13 @@ set`` commands.
9393
To configure the module to respond with possibly stale data, set
9494
the cache strategy to ``return``:
9595

96-
.. prompt:: bash $
96+
.. prompt:: bash #
9797

98-
ceph config set mgr mgr/prometheus/stale_cache_strategy return
98+
ceph config set mgr mgr/prometheus/stale_cache_strategy return
9999

100100
To configure the module to respond with "service unavailable", set it to ``fail``:
101101

102-
.. prompt:: bash $
102+
.. prompt:: bash #
103103

104104
ceph config set mgr mgr/prometheus/stale_cache_strategy fail
105105

@@ -113,23 +113,23 @@ If you are using the ``prometheus`` module behind a reverse proxy or
113113
load balancer, you can simplify discovery of the active instance by switching
114114
to ``error``-mode:
115115

116-
.. prompt:: bash $
116+
.. prompt:: bash #
117117

118118
ceph config set mgr mgr/prometheus/standby_behaviour error
119119

120120
If set, the ``prometheus`` module will respond with a HTTP error when requesting ``/``
121121
from the standby instance. The default error code is 500, but you can configure
122122
the HTTP response code with:
123123

124-
.. prompt:: bash $
124+
.. prompt:: bash #
125125

126126
ceph config set mgr mgr/prometheus/standby_error_status_code 503
127127

128128
Valid error codes are between 400-599.
129129

130130
To switch back to the default behaviour, simply set the config key to ``default``:
131131

132-
.. prompt:: bash $
132+
.. prompt:: bash #
133133

134134
ceph config set mgr mgr/prometheus/standby_behaviour default
135135

@@ -154,17 +154,20 @@ The metrics take the following form:
154154

155155
The health check history may be retrieved and cleared by running the following commands:
156156

157-
::
157+
.. prompt:: bash #
158158

159-
ceph healthcheck history ls [--format {plain|json|json-pretty}]
160-
ceph healthcheck history clear
159+
ceph healthcheck history ls [--format {plain|json|json-pretty}]
160+
ceph healthcheck history clear
161161

162162
The ``ceph healthcheck ls`` command provides an overview of the health checks that the cluster has
163163
encountered since the last ``clear`` command was issued:
164164

165+
.. prompt:: bash #
166+
167+
ceph healthcheck history ls
168+
165169
::
166170

167-
[ceph: root@c8-node1 /]# ceph healthcheck history ls
168171
Healthcheck Name First Seen (UTC) Last seen (UTC) Count Active
169172
OSDMAP_FLAGS 2021/09/16 03:17:47 2021/09/16 22:07:40 2 No
170173
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.
184187

185188
To enable collection of stats for RBD pools named ``pool1``, ``pool2`` and ``poolN``:
186189

187-
.. prompt:: bash $
190+
.. prompt:: bash #
188191

189192
ceph config set mgr mgr/prometheus/rbd_stats_pools "pool1,pool2,poolN"
190193

191194
A wildcard can be used to indicate all pools or namespaces:
192195

193-
.. prompt:: bash $
196+
.. prompt:: bash #
194197

195198
ceph config set mgr mgr/prometheus/rbd_stats_pools "*"
196199

@@ -203,7 +206,7 @@ RBD image.
203206

204207
To set the sync interval to 10 minutes run the following command:
205208

206-
.. prompt:: bash $
209+
.. prompt:: bash #
207210

208211
ceph config set mgr mgr/prometheus/rbd_stats_pools_refresh_interval 600
209212

@@ -214,7 +217,7 @@ With the introduction of the ``ceph-exporter`` daemon, the ``prometheus`` module
214217
perf counters as Prometheus metrics by default. However, one may re-enable exporting these metrics by setting
215218
the module option ``exclude_perf_counters`` to ``false``:
216219

217-
.. prompt:: bash $
220+
.. prompt:: bash #
218221

219222
ceph config set mgr mgr/prometheus/exclude_perf_counters false
220223

0 commit comments

Comments
 (0)