How Can We Help?
GitLab (Prometheus) Eating Disk Space
Do you own a GitLab server and is it eating more and more disk space? This article will help you to find the problem. In case it is related to Prometheus we will also provide some solutions.
Diagnose
To figure out what folder consumes the disk space run du -sh /path/*
. This will show the files and folders in the given folder with the size.
Prometheus eating space
If the storage issue is caused by /var/opt/gitlab/prometheus/data
, it means that Prometheus consumes a lot of data. You can solve this by either disabling Prometheus or limiting the service.
Disable Prometheus
To disable Prometheus open /etc/gitlab/gitlab.rb
and add/edit the following line:
prometheus_monitoring['enable'] = false
Now reconfigure GitLab using gitlab-ctl reconfigure
, this will automagically clean the Prometheus folder as well.
Limit Prometheus
In case you want to keep the Prometheus service in GitLab you can also limit the service. To do this open /etc/gitlab/gitlab.rb
and add/edit the following line:
prometheus['flags'] = {
'storage.tsdb.path' => "/var/opt/gitlab/prometheus/data",
'storage.tsdb.retention.time' => "7d",
'storage.tsdb.retention.size' => "2GB",
'config.file' => "/var/opt/gitlab/prometheus/prometheus.yml"
}
Now reconfigure GitLab using gitlab-ctl reconfigure
.
4 Responses
Your post provides some useful advice on the subject. Thanks for sharing your expertise with us.
Your insights and perspectives are refreshing and insightful.
I admire your talent to simplify complex concepts into accessible segments. Well done!
The article provides some useful advice on the topic. Thanks for sharing your expertise with us.