tonysun83 commented on a change in pull request #660:
URL:
https://github.com/apache/couchdb-documentation/pull/660#discussion_r645721622
##########
File path: src/api/server/common.rst
##########
@@ -1586,6 +1586,76 @@ 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/. The format version is
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
Review comment:
added an ellipsis (I think I did it correctly) in there. This was a good
catch. I had mistakenly added `_active_tasks` into the documentation because
originally I wanted the PR to include `_active_tasks`. But upon inspecting the
entire list output I realized I didn't have it. I went back to the PR and I
remembered that `_active_tasks` is a little different given how it's actually
something we accumulate at the top of chttpd and not per node. That's why I
excluded it for this first version. The next improvement would be to dig deeper
grab tasks per node.
--
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]