Expose new gitlab-exporter server type setting
What does this MR do?
We found that Puma is oversized for gitlab-exporter, which is a low traffic system and which does not benefit from concurrency. We have evidence that on SaaS a single-threaded Rack server such as WEBrick is sufficient to serve the relatively low volume of requests caused by Prometheus scrapers (all our in-app *_exporters already serve via WEBrick.)
We think that switching gitlab-exporter to WEBrick will result in lower memory requirements especially on single-node installations that run the GitLab Self-Monitoring service suite.
However, keeping this as a configuration switch leaves the door open to using more powerful servers such as Puma.
Related issues
- gitlab#293687 (closed)
- https://gitlab.com/gitlab-org/gitlab-exporter/-/merge_requests/127
- gitlab-org/charts/gitlab!1745 (merged)
Test plan
NOTE: this requires https://gitlab.com/gitlab-org/gitlab-exporter/-/merge_requests/127 to be merged first.
Step 1: Verify we run WEBrick by default now
- Enable gitlab self monitoring; see https://docs.gitlab.com/ee/administration/monitoring/gitlab_self_monitoring_project/
- Ensure gitlab-exporteris running, e.g.gitlab-ctl status gitlab-exporter
- Ensure it is running on WEBrick, e.g. by inspecting /var/log/gitlab/gitlab-exporter/current
2021-01-11_10:29:42.52692 [2021-01-11 10:29:42] INFO  WEBrick 1.6.0
2021-01-11_10:29:42.52694 [2021-01-11 10:29:42] INFO  ruby 2.7.2 (2020-10-01) [x86_64-linux]
2021-01-11_10:29:42.52735 == Sinatra (v2.0.8.1) has taken the stage on 9168 for development with backup from WEBrick
2021-01-11_10:29:42.52755 [2021-01-11 10:29:42] INFO  WEBrick::HTTPServer#start: pid=6426 port=9168Step 2: Change the Rack server
- Edit /etc/gitlab/gitlab.rb.
- Set the following
gitlab_exporter['server_name'] = 'puma'
- Save the file and reconfigure GitLab for the changes to take effect.
- Repeat the above steps to verify it is now running Puma.
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
- 
Merge Request Title, and Description are up to date, accurate, and descriptive 
- 
MR targeting the appropriate branch 
- 
MR has a green pipeline on GitLab.com 
- 
Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks 
- 
trigger-packagehas a green pipeline running against latest commit
Expected (please provide an explanation if not completing)
- 
Test plan indicating conditions for success has been posted and passes 
- 
Documentation created/updated. See: gitlab!51322 (merged) 
- 
Tests added 
- [-] Integration tests added to GitLab QA; We are not changing application behavior, and gitlab-exporter is not part of the existing test suite anyway.
- 
Equivalent MR/issue for the GitLab Chart opened: gitlab-org/charts/gitlab!1745 (merged)