Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make health check names user-configurable #193

Open
bborysenko opened this issue Jul 28, 2016 · 6 comments
Open

Make health check names user-configurable #193

bborysenko opened this issue Jul 28, 2016 · 6 comments

Comments

@bborysenko
Copy link

I'm going to run a local consul agent to be able to register a containers as separate nodes in consul. But would like to not register a checks in Consul with CheckID like <service>-<hostname> in this case. As far I understand it's not possible for the moment. But it would be great to have this in the nearest releases.

And even better - to have a human readable name for health checks. So instead of having on Consul something like:

{
  "Node": "a6fea2c9c3f4",
  "CheckID": "mysql-a6fea2c9c3f4",
  "Name": "mysql-a6fea2c9c3f4",
  "Status": "passing",
  ...
}

It would be great to define health check in this way:

"services": [
  {
    "name": "mysql",
    "port": 3306,
    "health": 
      {
        "name": "MySQL Health Status"
        "cmd": "/usr/bin/curl --fail -s http://localhost/nginx-health"
      },
    "poll": 10,
    "ttl": 25
  }
],

And finally get these from Consul:

{
  "Node": "a6fea2c9c3f4",
  "CheckID": "mysqlHealth",
  "Name": "MySQL Health Status ",
  "Status": "passing",
  ...
  }
@tgross
Copy link
Contributor

tgross commented Jul 29, 2016

I'm open to the idea of having user-configurable naming of the checks but the config syntax should be such that it's both backwards compatible and optional. So maybe if we were to do that we would make the human-readable health check name defined like so:

"services": [
  {
    "name": "example",
    "port": 3306,
    "health": "/usr/bin/curl --fail -s http://localhost/nginx-health",
    "checkId": "Example Health Status",
    "poll": 10,
    "ttl": 25
  }
],

The other question is what would this look like if we weren't using Consul but etcd instead? I'd like to avoid any config syntax that isn't portable across backends.

@tgross tgross changed the title Don't add hostname to the health check if we are using local Consul agent Make health check names user-configurable Aug 5, 2016
@tgross
Copy link
Contributor

tgross commented Aug 5, 2016

Retitled this issue and giving it the help wanted tag. It should be a pretty small PR for someone from the community to contribute a checkId flag to the services.Service configuration.

@tgross
Copy link
Contributor

tgross commented Nov 17, 2016

Marking this as a 2.x-compatible enhancement.

@tgross
Copy link
Contributor

tgross commented Mar 23, 2017

Ground work for this has been released in #290 and I'll add the config hooks for it during the v3 config update. Refer to RFD86 and the v3 roadmap in #283 for details.

@tgross
Copy link
Contributor

tgross commented Apr 7, 2017

Implemented in #316

@tgross tgross added the open PR label Apr 7, 2017
@tgross
Copy link
Contributor

tgross commented Apr 7, 2017

This multiple-health checks feature has undergone some internal review and we've decided to cut it, as the semantics of multiple health checks for a service don't really make sense given that we can only report to Consul once. That makes this a non-blocking issue for v3.0.

Proposed syntax:

jobs: [
  {
    name: "myJob",
    health: {
        name: "myJobCheck2",
        exec: "/bin/myCheck",
        interval: 3,
        ttl: 5
    }
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants