couchdb icon indicating copy to clipboard operation
couchdb copied to clipboard

[ENHANCEMENT]: system available memory add to Prometheus exporter output

Open sergey-safarov opened this issue 3 weeks ago • 1 comments

In CouchDB logs I see an error message

alarm_handler: {set,{system_memory_high_watermark,[]}}

The Erlang Memory Supervisor generated this error message. https://www.erlang.org/doc/apps/os_mon/memsup.html

As I understand, this alarm is not exported in the Prometheus format. However, it can be evaluated if the operating system reports available memory.

[root@localhost ~]# curl -s  http://127.0.0.1:17986/_node/_local/_prometheus | grep couchdb_erlang_memory_bytes
# HELP couchdb_erlang_memory_bytes size of memory (in bytes) dynamically allocated by the Erlang emulator
# TYPE couchdb_erlang_memory_bytes gauge
couchdb_erlang_memory_bytes{memory_type="total"} 1148480680
couchdb_erlang_memory_bytes{memory_type="processes"} 1061616376
couchdb_erlang_memory_bytes{memory_type="processes_used"} 1061601048
couchdb_erlang_memory_bytes{memory_type="system"} 86864304
couchdb_erlang_memory_bytes{memory_type="atom"} 680161
couchdb_erlang_memory_bytes{memory_type="atom_used"} 653349
couchdb_erlang_memory_bytes{memory_type="binary"} 39886392
couchdb_erlang_memory_bytes{memory_type="code"} 14128415
couchdb_erlang_memory_bytes{memory_type="ets"} 9573328

Currently, available system memory is not exported by the Prometheus exporter. Could you add these metric to the Prometheus exporter output?

Later, this can be used to generate an alarm when 80% of the available memory is used.

Tell us how the new feature should work. Be specific

Add system available memory to the Prometheus exporter output.

Not required. Suggest how to implement the addition or change

No response

Additional Context

No response

sergey-safarov avatar Dec 08 '25 15:12 sergey-safarov

I don't think it's appropriate for couchdb to report system metrics, you should use an appropriate tool to gather that if you need it.

rnewson avatar Dec 09 '25 15:12 rnewson