Interview Prep/Monitoring & Observability/Prometheus storage, memory and cardinality

Prometheus logs `too many open files`

IntermediateTroubleshootingPrometheus storage, memory and cardinality
Answer

Likely causes → The process file descriptor limit is too low for the number of blocks, WAL segments and scrape connections.

Diagnose →

cat /proc/$(pgrep prometheus)/limits | grep 'open files'
ls /proc/$(pgrep prometheus)/fd | wc -l
process_open_fds / process_max_fds

Fix → Set LimitNOFILE=65536 in the systemd unit or raise container ulimits.

Prevent → Alert on process_open_fds / process_max_fds > 0.8.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus storage, memory and cardinality