Skip to content

Commit

Permalink
Merge pull request #445 from selimekizoglu/consul-status
Browse files Browse the repository at this point in the history
Add consul initial check status to service attributes
  • Loading branch information
josegonzalez committed Sep 15, 2016
2 parents 7b98ea5 + 2f32794 commit f75a5dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions consul/consul.go
Expand Up @@ -88,6 +88,9 @@ func (r *ConsulAdapter) Register(service *bridge.Service) error {

func (r *ConsulAdapter) buildCheck(service *bridge.Service) *consulapi.AgentServiceCheck {
check := new(consulapi.AgentServiceCheck)
if status := service.Attrs["check_initial_status"]; status != "" {
check.Status = status
}
if path := service.Attrs["check_http"]; path != "" {
check.HTTP = fmt.Sprintf("http://%s:%d%s", service.IP, service.Port, path)
if timeout := service.Attrs["check_timeout"]; timeout != "" {
Expand Down
8 changes: 8 additions & 0 deletions docs/user/backends.md
Expand Up @@ -91,6 +91,14 @@ healthy.
SERVICE_CHECK_TTL=30s
```

### Consul Initial Health Check Status

By default when a service is registered against Consul, the state is set to "critical". You can specify the initial health check status.

```bash
SERVICE_CHECK_INITIAL_STATUS=passing
```

## Consul KV

consulkv://<address>:<port>/<prefix>
Expand Down

0 comments on commit f75a5dc

Please sign in to comment.