Honor the configuration of prometheus_multiproc_dir
What does this MR do?
Allow applications to manage cleanup of prometheus metrics files if desired
The gitlab-org/prometheus-client-mmap> allows applications to configure the storage of the metrics files in two ways:
-
Via configuration as:
Prometheus::Client.configure do |config| config.multiprocess_files_dir = '/some/application/defined/directory' end
-
Via environment -
ENV['prometheus_multiproc_dir']
This allows GitLab to manage the cleanup of these files externally when this environment variable is set. Currently, this cleanup does not happen at the correct time during application startup and results in some useful metrics files being invisible to the metrics exporter
Screenshots
Screen shots available in #37387 (closed)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
The risk that a customer has set prometheus_multiproc_dir
and expects GitLab to cleanup the files in that directory
This variable is set by gitlab-org/omnibus-gitlab>. Omnibus changes must be made to clean the metrics directory before exec'ing the services.
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team