You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wi...@apache.org on 2023/03/13 12:07:27 UTC

[couchdb] branch remove-prometheus-duplicates created (now 14078fd4b)

This is an automated email from the ASF dual-hosted git repository.

willholley pushed a change to branch remove-prometheus-duplicates
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at 14078fd4b fix: remove duplicate vm_stats from _prometheus

This branch includes the following new commits:

     new 14078fd4b fix: remove duplicate vm_stats from _prometheus

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: fix: remove duplicate vm_stats from _prometheus

Posted by wi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

willholley pushed a commit to branch remove-prometheus-duplicates
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 14078fd4ba2647833df18bdd5ad8758b3ff0ffe6
Author: Will Holley <wi...@apache.org>
AuthorDate: Fri Mar 10 09:10:40 2023 +0000

    fix: remove duplicate vm_stats from _prometheus
    
    The `_node/_local/_prometheus` was returning duplcate rows for the
    following metrics:
    
    ```
    couchdb_erlang_memory_bytes
    couchdb_erlang_gc_collections_total
    couchdb_erlang_gc_words_reclaimed_total
    couchdb_erlang_context_switches_total
    couchdb_erlang_reductions_total
    couchdb_erlang_processes
    couchdb_erlang_process_limit
    couchdb_erlang_io_recv_bytes_total
    couchdb_erlang_io_sent_bytes_total
    couchdb_erlang_message_queues
    couchdb_erlang_message_queue_min
    couchdb_erlang_message_queue_max
    couchdb_erlang_scheduler_queues
    couchdb_erlang_dirty_cpu_scheduler_queues
    ```
    
    Prometheus will gracefully handle the duplication, picking the first
    entry only, but it bloats the response and can potentially cause
    unexpected results if there's a signficant delay capturing the
    samples.
    
    The duplication is caused by a duplicate function call to
    `get_vm_stats()` in the prometheus endpoint handler. Removing the
    duplicate call fixes the problem.
---
 src/couch_prometheus/src/couch_prometheus_server.erl | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/couch_prometheus/src/couch_prometheus_server.erl b/src/couch_prometheus/src/couch_prometheus_server.erl
index 7a0eb4bf9..7597c7e28 100644
--- a/src/couch_prometheus/src/couch_prometheus_server.erl
+++ b/src/couch_prometheus/src/couch_prometheus_server.erl
@@ -108,7 +108,6 @@ get_couchdb_stats() ->
 get_system_stats() ->
     lists:flatten([
         get_uptime_stat(),
-        get_vm_stats(),
         get_io_stats(),
         get_message_queue_stats(),
         get_run_queue_stats(),