flimzy commented on a change in pull request #660:
URL:
https://github.com/apache/couchdb-documentation/pull/660#discussion_r644307570
##########
File path: src/api/server/common.rst
##########
@@ -1586,6 +1586,75 @@ node, you can use:
This returns an entire statistics object, as with the full request, but
containing only the requested individual statistic.
+============================
+``/_node/{node-name}/_prometheus``
+=============================
+
+.. http:get:: /_node/{node-name}/_prometheus
+ :synopsis: Returns server statistics in prometheus format
+
+ The ``_prometheus`` resource returns a text/plain response that
consolidates our
+ `_stats`, `active_task`, and `_system` endpoints. The format is determined
by
+ https://prometheus.io/docs/introduction/overview/. Currently the format
version 2.0.
+
+ **Request**:
+
+ .. code-block:: http
+
+ GET /_node/_local/_prometheus HTTP/1.1
+ Accept: text/plain
+ Host: localhost:5984
+
+ **Response**:
+
+ .. code-block:: http
+
+ HTTP/1.1 200 OK
+ Cache-Control: must-revalidate
+ Content-Length: 187
+ Content-Type: text/plain; version=2.0
+ Date: Sat, 10 May 2020 11:41:11 GMT
+ Server: CouchDB (Erlang/OTP)
+
+ # TYPE couchdb_uptime_seconds counter
+ couchdb_uptime_seconds 1
+ # TYPE couchdb_erlang_memory_bytes gauge
+ couchdb_erlang_memory_bytes{memory_type="total"} 71237784
+ couchdb_erlang_memory_bytes{memory_type="processes"} 12248504
+ couchdb_erlang_memory_bytes{memory_type="processes_used"} 12235928
+ couchdb_erlang_memory_bytes{memory_type="system"} 58989280
+ couchdb_erlang_memory_bytes{memory_type="atom"} 1172689
+ couchdb_erlang_memory_bytes{memory_type="atom_used"} 1156575
+ couchdb_erlang_memory_bytes{memory_type="binary"} 182568
+ couchdb_erlang_memory_bytes{memory_type="code"} 27819083
+ couchdb_erlang_memory_bytes{memory_type="ets"} 3143536
+ # TYPE couchdb_erlang_gc_collections_total counter
+ couchdb_erlang_gc_collections_total 13417
+ # TYPE couchdb_erlang_gc_words_reclaimed_total counter
+ couchdb_erlang_gc_words_reclaimed_total 71296018
+ # TYPE couchdb_erlang_context_switches_total counter
+ couchdb_erlang_context_switches_total 358276
+ # TYPE couchdb_erlang_reductions_total counter
+ couchdb_erlang_reductions_total 46527253
+ # TYPE couchdb_erlang_processes gauge
+ couchdb_erlang_processes 528
+ # TYPE couchdb_erlang_process_limit gauge
+ couchdb_erlang_process_limit 262144
+ couchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "docs_read"} 4524
+ ouchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "docs_written"} 4524
+ couchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "missing_revisions_found"} 4524
+
+If an additional port config option is specified, then a client can call this
api using a
Review comment:
```suggestion
If an additional port config option is specified, then a client can call
this API using
```
##########
File path: src/config/misc.rst
##########
@@ -269,3 +269,37 @@ Configuration of Database Purge
[purge]
index_lag_warn_seconds = 86400
+
+.. _config/prometheus:
+
+Configuration of Prometheus Endpoint
+===============================
+
+.. config:section:: prometheus :: Configuration of Prometheus Options
+
+ .. config:option:: additional_port
+
+ .. versionadded:: 3.2
+
+ Sets whether or not to create a separate, non-authenticated port
(default is false)::
+
+ [prometheus]
+ additional_port = true
+
+ .. config:option:: bind_address
+
+ .. versionadded:: 3.2
+
+ The ip address to bind::
+
+ [prometheus]
+ bind_address = 127.0.0.1
+
+ .. config:option:: port
+
+ .. versionadded:: 3.2
+
+ The port which clients can query prometheus endpoint data without
authentication
Review comment:
```suggestion
The port on which clients can query prometheus endpoint data without
authentication
```
##########
File path: src/api/server/common.rst
##########
@@ -1586,6 +1586,75 @@ node, you can use:
This returns an entire statistics object, as with the full request, but
containing only the requested individual statistic.
+============================
+``/_node/{node-name}/_prometheus``
+=============================
+
+.. http:get:: /_node/{node-name}/_prometheus
+ :synopsis: Returns server statistics in prometheus format
+
+ The ``_prometheus`` resource returns a text/plain response that
consolidates our
+ `_stats`, `active_task`, and `_system` endpoints. The format is determined
by
+ https://prometheus.io/docs/introduction/overview/. Currently the format
version 2.0.
+
+ **Request**:
+
+ .. code-block:: http
+
+ GET /_node/_local/_prometheus HTTP/1.1
+ Accept: text/plain
+ Host: localhost:5984
+
+ **Response**:
+
+ .. code-block:: http
+
+ HTTP/1.1 200 OK
+ Cache-Control: must-revalidate
+ Content-Length: 187
+ Content-Type: text/plain; version=2.0
+ Date: Sat, 10 May 2020 11:41:11 GMT
+ Server: CouchDB (Erlang/OTP)
+
+ # TYPE couchdb_uptime_seconds counter
+ couchdb_uptime_seconds 1
+ # TYPE couchdb_erlang_memory_bytes gauge
+ couchdb_erlang_memory_bytes{memory_type="total"} 71237784
+ couchdb_erlang_memory_bytes{memory_type="processes"} 12248504
+ couchdb_erlang_memory_bytes{memory_type="processes_used"} 12235928
+ couchdb_erlang_memory_bytes{memory_type="system"} 58989280
+ couchdb_erlang_memory_bytes{memory_type="atom"} 1172689
+ couchdb_erlang_memory_bytes{memory_type="atom_used"} 1156575
+ couchdb_erlang_memory_bytes{memory_type="binary"} 182568
+ couchdb_erlang_memory_bytes{memory_type="code"} 27819083
+ couchdb_erlang_memory_bytes{memory_type="ets"} 3143536
+ # TYPE couchdb_erlang_gc_collections_total counter
+ couchdb_erlang_gc_collections_total 13417
+ # TYPE couchdb_erlang_gc_words_reclaimed_total counter
+ couchdb_erlang_gc_words_reclaimed_total 71296018
+ # TYPE couchdb_erlang_context_switches_total counter
+ couchdb_erlang_context_switches_total 358276
+ # TYPE couchdb_erlang_reductions_total counter
+ couchdb_erlang_reductions_total 46527253
+ # TYPE couchdb_erlang_processes gauge
+ couchdb_erlang_processes 528
+ # TYPE couchdb_erlang_process_limit gauge
+ couchdb_erlang_process_limit 262144
+ couchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "docs_read"} 4524
+ ouchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "docs_written"} 4524
+ couchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "missing_revisions_found"} 4524
+
+If an additional port config option is specified, then a client can call this
api using a
+that port which does not require authentication. This option is false(OFF) by
default.
Review comment:
```suggestion
that port which does not require authentication. This option is ``false``
(OFF) by default.
```
##########
File path: src/api/server/common.rst
##########
@@ -1586,6 +1586,75 @@ node, you can use:
This returns an entire statistics object, as with the full request, but
containing only the requested individual statistic.
+============================
+``/_node/{node-name}/_prometheus``
+=============================
+
+.. http:get:: /_node/{node-name}/_prometheus
+ :synopsis: Returns server statistics in prometheus format
+
+ The ``_prometheus`` resource returns a text/plain response that
consolidates our
+ `_stats`, `active_task`, and `_system` endpoints. The format is determined
by
+ https://prometheus.io/docs/introduction/overview/. Currently the format
version 2.0.
+
+ **Request**:
+
+ .. code-block:: http
+
+ GET /_node/_local/_prometheus HTTP/1.1
+ Accept: text/plain
+ Host: localhost:5984
+
+ **Response**:
+
+ .. code-block:: http
+
+ HTTP/1.1 200 OK
+ Cache-Control: must-revalidate
+ Content-Length: 187
+ Content-Type: text/plain; version=2.0
+ Date: Sat, 10 May 2020 11:41:11 GMT
+ Server: CouchDB (Erlang/OTP)
+
+ # TYPE couchdb_uptime_seconds counter
+ couchdb_uptime_seconds 1
+ # TYPE couchdb_erlang_memory_bytes gauge
+ couchdb_erlang_memory_bytes{memory_type="total"} 71237784
+ couchdb_erlang_memory_bytes{memory_type="processes"} 12248504
+ couchdb_erlang_memory_bytes{memory_type="processes_used"} 12235928
+ couchdb_erlang_memory_bytes{memory_type="system"} 58989280
+ couchdb_erlang_memory_bytes{memory_type="atom"} 1172689
+ couchdb_erlang_memory_bytes{memory_type="atom_used"} 1156575
+ couchdb_erlang_memory_bytes{memory_type="binary"} 182568
+ couchdb_erlang_memory_bytes{memory_type="code"} 27819083
+ couchdb_erlang_memory_bytes{memory_type="ets"} 3143536
+ # TYPE couchdb_erlang_gc_collections_total counter
+ couchdb_erlang_gc_collections_total 13417
+ # TYPE couchdb_erlang_gc_words_reclaimed_total counter
+ couchdb_erlang_gc_words_reclaimed_total 71296018
+ # TYPE couchdb_erlang_context_switches_total counter
+ couchdb_erlang_context_switches_total 358276
+ # TYPE couchdb_erlang_reductions_total counter
+ couchdb_erlang_reductions_total 46527253
+ # TYPE couchdb_erlang_processes gauge
+ couchdb_erlang_processes 528
+ # TYPE couchdb_erlang_process_limit gauge
+ couchdb_erlang_process_limit 262144
+ couchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "docs_read"} 4524
+ ouchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "docs_written"} 4524
+ couchdb_active_task{type="replication", source="mailbox",
target="http://mailsrv:5984/mailbox <http://mailsrv:5984/mailbox>", docs_count
= "missing_revisions_found"} 4524
+
+If an additional port config option is specified, then a client can call this
api using a
+that port which does not require authentication. This option is false(OFF) by
default.
+When the option true(ON), the default ports for a 3 node cluster are 17986,
27986, 37986.
Review comment:
```suggestion
When the option is ``true`` (ON), the default ports for a 3 node cluster are
``17986``, ``27986``, and ``37986``.
```
##########
File path: src/config/misc.rst
##########
@@ -269,3 +269,37 @@ Configuration of Database Purge
[purge]
index_lag_warn_seconds = 86400
+
+.. _config/prometheus:
+
+Configuration of Prometheus Endpoint
+===============================
+
+.. config:section:: prometheus :: Configuration of Prometheus Options
+
+ .. config:option:: additional_port
+
+ .. versionadded:: 3.2
+
+ Sets whether or not to create a separate, non-authenticated port
(default is false)::
+
+ [prometheus]
+ additional_port = true
+
+ .. config:option:: bind_address
+
+ .. versionadded:: 3.2
+
+ The ip address to bind::
Review comment:
```suggestion
The IP address to bind::
```
##########
File path: src/api/server/common.rst
##########
@@ -1586,6 +1586,75 @@ node, you can use:
This returns an entire statistics object, as with the full request, but
containing only the requested individual statistic.
+============================
+``/_node/{node-name}/_prometheus``
+=============================
+
+.. http:get:: /_node/{node-name}/_prometheus
+ :synopsis: Returns server statistics in prometheus format
+
+ The ``_prometheus`` resource returns a text/plain response that
consolidates our
+ `_stats`, `active_task`, and `_system` endpoints. The format is determined
by
+ https://prometheus.io/docs/introduction/overview/. Currently the format
version 2.0.
Review comment:
I feel like this last sentence is missing a word? "Currently the format
version is 2.0" perhaps?
Also, we can probably remove the word "Currently", as I think that's
implicit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]