TritonDataCenter / containerpilot

A service for autodiscovery and configuration of applications running in containers
Mozilla Public License 2.0
1.12k stars 136 forks source link

Include jobs with health checks in /status #507

Closed geek closed 7 years ago

geek commented 7 years ago

In the services array we should include any jobs that have a health check. This will mean that they may not have an address or port, but they can at least report on their health status.

For example, given the following jobs config:

jobs: [
    {
      name: 'foo',
      exec: 'node /opt/app/',
      restarts: 'unlimited',
      health: {
        exec: 'pgrep node',
        interval: 10,
        ttl: 20
      }
    }
]

The current /status endpoint doesn't return any values in the Services array for the above job, instead, we should return:

Services: [{ Name: 'foo', Status: 'healthy' }]

This will be useful for checking the status of services that aren't registered with consul but still have health checks.