{
  consul: 'localhost:8500',
  jobs: [
    {
      name: 'serializer',
      port: {{.PORT}},
      exec: 'node /opt/app/',
      health: {
        exec: '/usr/bin/curl -o /dev/null --fail -s http://127.0.0.1:{{.PORT}}/check-it-out',
        interval: 1,
        ttl: 2
      },
      restarts: 'unlimited'
    },
    {
      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: 'onchange-influxdb',
      exec: 'pkill -SIGHUP node',
      when: {
        source: 'watch.influxdb',
        each: 'changed'
      }
    },
    {
      name: 'requests-sensor',
      exec: '/bin/sensors/request_count.sh',
      timeout: '5s',
      when: {
        interval: '5s'
      },
      restarts: 'unlimited'
    }
  ],
  watches: [
    {
      name: 'influxdb',
      interval: 2
    }
  ],
  telemetry: {
    port: 9090,
    tags: ['op'],
    interfaces: ['eth1', 'eth0', 'eth0[1]', 'lo', 'lo0', 'inet'],
    metrics: [
      {
        namespace: 'example',
        subsystem: 'serializer',
        name: 'requests',
        help: 'Number of requests/5s',
        type: 'gauge'
      },
      {
        namespace: 'example',
        subsystem: 'process',
        name: 'event_delay',
        help: 'Node.js event loop delay',
        type: 'gauge'
      }
    ]
  }
}
