gitlab-monitor.yml.example 2.7 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

Maxime Guyot's avatar
Maxime Guyot committed
64
  process: &process
65
    methods:
Ben Kochie's avatar
Ben Kochie committed
66
      - probe_stat
67
      - probe_count
68
      - probe_smaps
69 70 71
    opts:
      - pid_or_pattern: "sidekiq .* \\[.*?\\]"
        name: sidekiq
72
      - pid_or_pattern: "unicorn.* worker\\[.*?\\]"
73 74 75
        name: unicorn
      - pid_or_pattern: "git-upload-pack --stateless-rpc"
        name: git_upload_pack
76
        quantiles: true
Ahmad Sherif's avatar
Ahmad Sherif committed
77

Maxime Guyot's avatar
Maxime Guyot committed
78
  sidekiq: &sidekiq
Ahmad Sherif's avatar
Ahmad Sherif committed
79 80
    methods:
      - probe_queues
81
      - probe_jobs
Ahmad Sherif's avatar
Ahmad Sherif committed
82 83
      - probe_workers
      - probe_retries
Ahmad Sherif's avatar
Ahmad Sherif committed
84
      - probe_dead
Ahmad Sherif's avatar
Ahmad Sherif committed
85 86
    opts:
      redis_url: "redis://localhost:6379"
87
      redis_enable_client: true
Maxime Guyot's avatar
Maxime Guyot committed
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105

  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
106