Skip to content
Snippets Groups Projects

WIP: gitlab-ctl statuses

Closed username-removed-475751 requested to merge gitlab-ctl-statuses into master
1 unresolved thread

this MR gives output like

gitlab_service_up{name="gitlab-workhorse"} 1 1476646371941
gitlab_service_up{name="logrotate"} 1 1476646371941
gitlab_service_up{name="mailroom"} 1 1476646371941
gitlab_service_up{name="mattermost"} 0 1476646371941
gitlab_service_up{name="postgresql"} 1 1476646371941
gitlab_service_up{name="redis"} 1 1476646371941
gitlab_service_up{name="sidekiq"} 1 1476646371941
gitlab_service_up{name="unicorn"} 1 1476646371941

but there is requirements to obtain this information:

  1. gitlab-monitor must be run under root (or prometheus user must be in sudoers)
  2. data obtained via sudo gitlab-ctl status

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
4 class Services
5 def write_to(target)
6 @metrics = PrometheusMetrics.new
7
8 out = `gitlab-ctl status`
9 out.each_line do |line|
10 vars = line.split(":")
11 status = vars[0].strip
12 name = vars[1].strip
13 value =
14 if status == "run"
15 1
16 else
17 0
18 end
19 @metrics.add "gitlab_service_up{name=\"#{name}\"}", value
  • Added 1 commit:

    • 0f87a6f5 - updated services and added specs

    Compare with previous version

  • Added 5 commits:

    • 0f87a6f5...b3052878 - 4 commits from branch master
    • 2833dc17 - Merge branch 'master' into gitlab-ctl-statuses

    Compare with previous version

  • Added 1 commit:

    • 2d560a55 - fixes on Services utility

    Compare with previous version

  • Added 1 commit:

    • ac792d8c - completed web part

    Compare with previous version

  • Added 1 commit:

    • 8a708bbb - adding checking for gitlab_service

    Compare with previous version

  • Added 1 commit:

    Compare with previous version

  • @maratkalibek please rebase or fix the conflicts and resolve the comments

  • Please register or sign in to reply
    Loading