Skip to content

Expose new gitlab-exporter server type setting

Matthias Käppler requested to merge mk-gitlab-exporter-server-setting into master

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

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

  1. Enable gitlab self monitoring; see https://docs.gitlab.com/ee/administration/monitoring/gitlab_self_monitoring_project/
  2. Ensure gitlab-exporter is running, e.g. gitlab-ctl status gitlab-exporter
  3. 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=9168

Step 2: Change the Rack server

  1. Edit /etc/gitlab/gitlab.rb.
  2. Set the following
    gitlab_exporter['server_name'] = 'puma'
  3. Save the file and reconfigure GitLab for the changes to take effect.
  4. 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-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

Edited by Matthias Käppler

Merge request reports