mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	puppet: Add a uwsgi exporter for monitoring.
This allows investigation of how many workers are busy, and to track "harikari" terminations.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							d6c40d24d4
						
					
				
				
					commit
					8a5be972d2
				
			@@ -97,5 +97,14 @@ class zulip::common {
 | 
				
			|||||||
        'aarch64' => '2d185a8ed46161babeaaac8ce00ef1efdeccf3ef4ed234cd181eac6cad1ae4b2',
 | 
					        'aarch64' => '2d185a8ed46161babeaaac8ce00ef1efdeccf3ef4ed234cd181eac6cad1ae4b2',
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # https://github.com/timonwong/uwsgi_exporter/releases
 | 
				
			||||||
 | 
					    'uwsgi_exporter' => {
 | 
				
			||||||
 | 
					      'version' => '1.0.0',
 | 
				
			||||||
 | 
					      'sha256' => {
 | 
				
			||||||
 | 
					        'amd64'   => '7e924dec77bca1052b4782dcf31f0c6b2ebe71d6bf4a72412b97fec45962cef0',
 | 
				
			||||||
 | 
					        'aarch64' => 'b36e26c8e94f1954c76aa9e9920be2f84ecc12b34f14a81086fedade8c48cb74',
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,8 @@ env= LANG=C.UTF-8
 | 
				
			|||||||
uid=zulip
 | 
					uid=zulip
 | 
				
			||||||
gid=zulip
 | 
					gid=zulip
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					stats=/home/zulip/deployments/uwsgi-stats
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ignore-sigpipe = true
 | 
					ignore-sigpipe = true
 | 
				
			||||||
ignore-write-errors = true
 | 
					ignore-write-errors = true
 | 
				
			||||||
disable-write-exception = true
 | 
					disable-write-exception = true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
# @summary Munin monitoring of a Django frontend and RabbitMQ server.
 | 
					# @summary Munin monitoring of a Django frontend and RabbitMQ server.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
class zulip_ops::app_frontend_monitoring {
 | 
					class zulip_ops::app_frontend_monitoring {
 | 
				
			||||||
 | 
					  include zulip_ops::prometheus::uwsgi
 | 
				
			||||||
  include zulip_ops::munin_node
 | 
					  include zulip_ops::munin_node
 | 
				
			||||||
  $munin_plugins = [
 | 
					  $munin_plugins = [
 | 
				
			||||||
    'rabbitmq_connections',
 | 
					    'rabbitmq_connections',
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										31
									
								
								puppet/zulip_ops/manifests/prometheus/uwsgi.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								puppet/zulip_ops/manifests/prometheus/uwsgi.pp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					# @summary Prometheus monitoring of uwsgi servers
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					class zulip_ops::prometheus::uwsgi {
 | 
				
			||||||
 | 
					  $version = $zulip::common::versions['uwsgi_exporter']['version']
 | 
				
			||||||
 | 
					  $dir = "/srv/zulip-uwsgi_exporter-${version}"
 | 
				
			||||||
 | 
					  $bin = "${dir}/uwsgi_exporter"
 | 
				
			||||||
 | 
					  $arch = $::architecture ? {
 | 
				
			||||||
 | 
					    'amd64'   => 'amd64',
 | 
				
			||||||
 | 
					    'aarch64' => 'arm64',
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  zulip::external_dep { 'uwsgi_exporter':
 | 
				
			||||||
 | 
					    version        => $version,
 | 
				
			||||||
 | 
					    url            => "https://github.com/timonwong/uwsgi_exporter/releases/download/v${version}/uwsgi_exporter-${version}.linux-${arch}.tar.gz",
 | 
				
			||||||
 | 
					    tarball_prefix => "uwsgi_exporter-${version}.linux-${arch}",
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  zulip_ops::firewall_allow { 'uwsgi_exporter': port => '9238' }
 | 
				
			||||||
 | 
					  file { "${zulip::common::supervisor_conf_dir}/prometheus_uwsgi_exporter.conf":
 | 
				
			||||||
 | 
					    ensure  => file,
 | 
				
			||||||
 | 
					    require => [
 | 
				
			||||||
 | 
					      User[zulip],
 | 
				
			||||||
 | 
					      Package[supervisor],
 | 
				
			||||||
 | 
					      Zulip::External_Dep['node_exporter'],
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    owner   => 'root',
 | 
				
			||||||
 | 
					    group   => 'root',
 | 
				
			||||||
 | 
					    mode    => '0644',
 | 
				
			||||||
 | 
					    content => template('zulip_ops/supervisor/conf.d/prometheus_uwsgi_exporter.conf.template.erb'),
 | 
				
			||||||
 | 
					    notify  => Service[supervisor],
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					[program:prometheus_uwsgi_exporter]
 | 
				
			||||||
 | 
					command=<%= @bin %> --stats.uri=unix:///home/zulip/deployments/uwsgi-stats --web.listen-address=:9238
 | 
				
			||||||
 | 
					priority=10
 | 
				
			||||||
 | 
					autostart=true
 | 
				
			||||||
 | 
					autorestart=true
 | 
				
			||||||
 | 
					user=zulip
 | 
				
			||||||
 | 
					redirect_stderr=true
 | 
				
			||||||
 | 
					stdout_logfile=/var/log/zulip/uwsgi_exporter.log
 | 
				
			||||||
		Reference in New Issue
	
	Block a user