Skip to content

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

@sergey-safarov

Description

@sergey-safarov

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions