2017-06-20 02:52:20 +03:00
|
|
|
{
|
|
|
|
consul: 'localhost:8500',
|
|
|
|
jobs: [
|
2017-06-22 20:08:13 +03:00
|
|
|
{
|
2017-06-22 23:52:09 +03:00
|
|
|
name: 'setup-config',
|
|
|
|
exec: '/bin/prestart.sh'
|
2017-06-22 20:08:13 +03:00
|
|
|
},
|
2017-06-21 19:15:17 +03:00
|
|
|
{
|
|
|
|
name: 'bootstrap',
|
2017-06-22 20:08:13 +03:00
|
|
|
exec: 'node bootstrap-data.js',
|
|
|
|
when: {
|
|
|
|
source: 'setup-config',
|
|
|
|
once: 'exitSuccess'
|
|
|
|
}
|
2017-06-21 19:15:17 +03:00
|
|
|
},
|
2017-06-20 02:52:20 +03:00
|
|
|
{
|
|
|
|
name: 'api',
|
|
|
|
port: {{.PORT}},
|
|
|
|
exec: 'node server.js',
|
|
|
|
health: {
|
|
|
|
exec: '/usr/bin/curl -o /dev/null --fail -s http://localhost:{{.PORT}}/check-it-out',
|
2017-06-22 23:52:09 +03:00
|
|
|
interval: 5,
|
2017-06-20 02:52:20 +03:00
|
|
|
ttl: 5
|
|
|
|
},
|
2017-06-22 04:05:45 +03:00
|
|
|
when: {
|
|
|
|
source: 'bootstrap',
|
|
|
|
once: 'exitSuccess'
|
2017-06-22 20:08:13 +03:00
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
2017-06-20 02:52:20 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'consul-agent',
|
|
|
|
exec: ['/usr/local/bin/consul', 'agent',
|
|
|
|
'-data-dir=/data',
|
|
|
|
'-config-dir=/config',
|
|
|
|
'-log-level=err',
|
|
|
|
'-rejoin',
|
|
|
|
'-retry-join', '{{ .CONSUL | default "consul" }}',
|
|
|
|
'-retry-max', '10',
|
|
|
|
'-retry-interval', '10s'],
|
|
|
|
restarts: 'unlimited'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sensor_memory_usage',
|
2017-06-23 19:24:25 +03:00
|
|
|
exec: '/bin/sensors.sh memory',
|
2017-06-20 02:52:20 +03:00
|
|
|
timeout: '5s',
|
|
|
|
when: {
|
|
|
|
interval: '5s'
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sensor_cpu_load',
|
2017-06-23 19:24:25 +03:00
|
|
|
exec: '/bin/sensors.sh cpu',
|
2017-06-20 02:52:20 +03:00
|
|
|
timeout: '5s',
|
|
|
|
when: {
|
|
|
|
interval: '5s'
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sensor_disk_capacity',
|
2017-06-23 19:24:25 +03:00
|
|
|
exec: '/bin/sensors.sh diskcapacity',
|
2017-06-20 02:52:20 +03:00
|
|
|
timeout: '5s',
|
|
|
|
when: {
|
|
|
|
interval: '60s'
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sensor_disk_usage',
|
2017-06-23 19:24:25 +03:00
|
|
|
exec: '/bin/sensors.sh diskusage',
|
2017-06-20 02:52:20 +03:00
|
|
|
timeout: '5s',
|
|
|
|
when: {
|
|
|
|
interval: '60s'
|
|
|
|
},
|
|
|
|
restarts: 'unlimited'
|
2017-06-21 21:51:28 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'onchange-compose-api',
|
|
|
|
exec: 'pkill -SIGHUP node',
|
|
|
|
when: {
|
|
|
|
source: 'watch.docker-compose-api',
|
|
|
|
each: 'changed'
|
2017-06-23 19:24:25 +03:00
|
|
|
}
|
2017-06-21 21:51:28 +03:00
|
|
|
},
|
2017-08-10 22:56:29 +03:00
|
|
|
{
|
|
|
|
name: 'onchange-rethinkdb',
|
|
|
|
exec: 'pkill -SIGHUP node',
|
|
|
|
when: {
|
|
|
|
source: 'watch.rethinkdb',
|
|
|
|
each: 'changed'
|
|
|
|
}
|
|
|
|
}
|
2017-06-21 21:51:28 +03:00
|
|
|
],
|
|
|
|
watches: [
|
|
|
|
{
|
|
|
|
name: 'docker-compose-api',
|
|
|
|
interval: 3
|
2017-08-10 22:56:29 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'rethinkdb',
|
|
|
|
interval: 3
|
2017-06-20 02:52:20 +03:00
|
|
|
}
|
|
|
|
],
|
|
|
|
telemetry: {
|
|
|
|
port: 9090,
|
|
|
|
tags: ['op'],
|
|
|
|
metrics: [
|
|
|
|
{
|
|
|
|
namespace: 'api',
|
|
|
|
subsystem: 'memory',
|
|
|
|
name: 'percent',
|
|
|
|
help: 'Percentage of memory used',
|
|
|
|
type: 'gauge'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
namespace: 'api',
|
|
|
|
subsystem: 'cpu',
|
|
|
|
name: 'load',
|
|
|
|
help: 'CPU load',
|
|
|
|
type: 'gauge'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
namespace: 'api',
|
|
|
|
subsystem: 'disk',
|
|
|
|
name: 'capacity',
|
|
|
|
help: 'Disk capacity',
|
|
|
|
type: 'gauge'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
namespace: 'api',
|
|
|
|
subsystem: 'disk',
|
|
|
|
name: 'usage',
|
|
|
|
help: 'Disk usage',
|
|
|
|
type: 'gauge'
|
2017-06-21 00:11:47 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
namespace: 'api',
|
|
|
|
subsystem: 'request',
|
|
|
|
name: 'concurrent',
|
|
|
|
help: 'Number of concurrent requests',
|
|
|
|
type: 'gauge'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
namespace: 'api',
|
|
|
|
subsystem: 'process',
|
|
|
|
name: 'up_time',
|
|
|
|
help: 'Process up time',
|
|
|
|
type: 'counter'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
namespace: 'api',
|
|
|
|
subsystem: 'process',
|
|
|
|
name: 'mem_rss',
|
|
|
|
help: 'Process memory RSS usage',
|
|
|
|
type: 'gauge'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
namespace: 'api',
|
|
|
|
subsystem: 'process',
|
|
|
|
name: 'heap_used',
|
|
|
|
help: 'Process heap usage',
|
|
|
|
type: 'gauge'
|
2017-06-20 02:52:20 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|