gitlab-monitor.yml.example 2.84 KB
Newer Older
Ahmad Sherif's avatar
Ahmad Sherif committed
1 2 3
db_common: &db_common
  methods:
    - probe_db
4
  opts: &db_common_opts
Ahmad Sherif's avatar
Ahmad Sherif committed
5 6 7
    connection_string: dbname=gitlabhq_development user=postgres

# Web server config
8 9
server:
  listen_address: 0.0.0.0
10
  listen_port: 9168
11 12
  # Maximum amount of memory to use in megabytes, after which the process is killed
  memory_threshold: 1024
13

Ahmad Sherif's avatar
Ahmad Sherif committed
14
# Probes config
15
probes:
Ahmad Sherif's avatar
Ahmad Sherif committed
16 17 18
  # Each key corresponds to an endpoint, so here metrics are available at http://localhost:9168/git.
  # The server will search for a prober using the format `KeyProber`, so here it will be `GitProber`.
  # If there's no prober matching the format above, `class_name` key should be provided (see `git_process` below).
19
  git:
Ahmad Sherif's avatar
Ahmad Sherif committed
20
    # Methods to call on the prober
21 22 23
    methods:
      - probe_pull
      - probe_push
Ahmad Sherif's avatar
Ahmad Sherif committed
24
    # Options to pass to the prober class initializer
25 26
    opts:
      source: /home/git/repo
Ahmad Sherif's avatar
Ahmad Sherif committed
27

Maxime Guyot's avatar
Maxime Guyot committed
28
  git_process: &git_process
Ahmad Sherif's avatar
Ahmad Sherif committed
29 30 31 32 33 34
    class_name: GitProcessProber # `class_name` is redundant here
    methods:
    - probe_git
    opts:
      quantiles: true

Andreas Brandl's avatar
Andreas Brandl committed
35 36 37 38
  database_bloat:
    class_name: Database::BloatProber
    <<: *db_common

Ahmad Sherif's avatar
Ahmad Sherif committed
39 40 41 42 43 44 45
  # We can group multiple probes under a single endpoint by setting the `multiple` key to `true`, followed
  # by probe definitions as usual.
  database:
    multiple: true
    ci_builds:
      class_name: Database::CiBuildsProber
      <<: *db_common
46 47 48
      opts:
        <<: *db_common_opts
        allowed_repeated_commands_count: 2
49
        created_builds_counting_disabled: true
50
        unarchived_traces_offset_minutes: 1440
Ahmad Sherif's avatar
Ahmad Sherif committed
51 52 53 54 55 56
    tuple_stats:
      class_name: Database::TuplesProber
      <<: *db_common
    rows_count:
      class_name: Database::RowCountProber
      <<: *db_common
57 58 59 60 61 62
      opts:
        <<: *db_common_opts
        selected_queries:
        - soft_deleted_projects
        - orphaned_projects
        - uploads
Ahmad Sherif's avatar
Ahmad Sherif committed
63
    remote_mirrors:
64
      class_name: Database::RemoteMirrorsProber
Ahmad Sherif's avatar
Ahmad Sherif committed
65 66 67 68 69
      <<: *db_common
      opts:
        <<: *db_common_opts
        project_ids:
        - 1
Ahmad Sherif's avatar
Ahmad Sherif committed
70

Maxime Guyot's avatar
Maxime Guyot committed
71
  process: &process
72
    methods:
Ben Kochie's avatar
Ben Kochie committed
73
      - probe_stat
74
      - probe_count
75 76 77
    opts:
      - pid_or_pattern: "sidekiq .* \\[.*?\\]"
        name: sidekiq
78
      - pid_or_pattern: "unicorn.* worker\\[.*?\\]"
79 80 81
        name: unicorn
      - pid_or_pattern: "git-upload-pack --stateless-rpc"
        name: git_upload_pack
82
        quantiles: true
Ahmad Sherif's avatar
Ahmad Sherif committed
83

Maxime Guyot's avatar
Maxime Guyot committed
84
  sidekiq: &sidekiq
Ahmad Sherif's avatar
Ahmad Sherif committed
85
    methods:
chiehminw's avatar
chiehminw committed
86
      - probe_stats
Ahmad Sherif's avatar
Ahmad Sherif committed
87
      - probe_queues
88
      - probe_jobs
Ahmad Sherif's avatar
Ahmad Sherif committed
89 90 91 92
      - probe_workers
      - probe_retries
    opts:
      redis_url: "redis://localhost:6379"
93
      redis_enable_client: true
Maxime Guyot's avatar
Maxime Guyot committed
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

  metrics:
    multiple: true
    git_process:
      <<: *git_process
    process:
      <<: *process
    sidekiq:
      <<: *sidekiq
    ci_builds:
      class_name: Database::CiBuildsProber
      <<: *db_common
    tuple_stats:
      class_name: Database::TuplesProber
      <<: *db_common
    rows_count:
      class_name: Database::RowCountProber
      <<: *db_common
112