Disable writing of metrics if `prometheus_multiproc_dir` not defined

Previously we would fallback to a temporary directory if prometheus_multiproc_dir were not defined. This would cause lots of temporary directories to accumulate from processes that don't need metrics (e.g. Rake tasks). We solve this by writing to /dev/null whenever a file is expected to be opened.

Relates to https://gitlab.com/gitlab-org/prometheus-client-mmap/-/issues/34

Edited by Stan Hu

Merge request reports

Loading