{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/consul/issues/740","labels_url":"https://api.github.com/repos/hashicorp/consul/issues/740/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul/issues/740/comments","events_url":"https://api.github.com/repos/hashicorp/consul/issues/740/events","html_url":"https://github.com/hashicorp/consul/issues/740","id":59060580,"number":740,"title":"allow specifying check id for service","user":{"login":"blalor","id":109915,"avatar_url":"https://avatars.githubusercontent.com/u/109915?v=3","gravatar_id":"","url":"https://api.github.com/users/blalor","html_url":"https://github.com/blalor","followers_url":"https://api.github.com/users/blalor/followers","following_url":"https://api.github.com/users/blalor/following{/other_user}","gists_url":"https://api.github.com/users/blalor/gists{/gist_id}","starred_url":"https://api.github.com/users/blalor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blalor/subscriptions","organizations_url":"https://api.github.com/users/blalor/orgs","repos_url":"https://api.github.com/users/blalor/repos","events_url":"https://api.github.com/users/blalor/events{/privacy}","received_events_url":"https://api.github.com/users/blalor/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/consul/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-26T11:46:15Z","updated_at":"2015-03-31T06:11:06Z","closed_at":null,"body":"I'd like to be able to specify the id for a check associated with a service.  The notes field is useful for human-readable text about the check, but it would be useful to have a more structured id to use for alerting. For example, I have two checks for mysql: one for aliveness and another for replication on slaves.  The generated id for the replication check is `service:mysql:2` but I'd like to have `service:mysql:replication`.\r\n\r\nCheck IDs for a service are of the form `service:<service_id>[:<index>]` and the `id` property is ignored when reading the service definition from a file.  By specifying the check id it would be possible to have `service:<service_id>:<check_id>`, with a fallback to the other format.  "},"comment":{"url":"https://api.github.com/repos/hashicorp/consul/issues/comments/87954899","html_url":"https://github.com/hashicorp/consul/issues/740#issuecomment-87954899","issue_url":"https://api.github.com/repos/hashicorp/consul/issues/740","id":87954899,"user":{"login":"cruatta","id":2013264,"avatar_url":"https://avatars.githubusercontent.com/u/2013264?v=3","gravatar_id":"","url":"https://api.github.com/users/cruatta","html_url":"https://github.com/cruatta","followers_url":"https://api.github.com/users/cruatta/followers","following_url":"https://api.github.com/users/cruatta/following{/other_user}","gists_url":"https://api.github.com/users/cruatta/gists{/gist_id}","starred_url":"https://api.github.com/users/cruatta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cruatta/subscriptions","organizations_url":"https://api.github.com/users/cruatta/orgs","repos_url":"https://api.github.com/users/cruatta/repos","events_url":"https://api.github.com/users/cruatta/events{/privacy}","received_events_url":"https://api.github.com/users/cruatta/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T06:11:06Z","updated_at":"2015-03-31T06:11:06Z","body":"I was looking into this and the issue is the way ServiceDefinition is defined. \r\n\r\n```\r\ntype ServiceDefinition struct {\r\n\tID      string\r\n\tName    string\r\n\tTags    []string\r\n\tAddress string\r\n\tPort    int\r\n\tCheck   CheckType\r\n\tChecks  CheckTypes\r\n}\r\n```\r\n\r\n```\r\ntype CheckType struct {\r\n\tScript   string\r\n\tHTTP     string\r\n\tInterval time.Duration\r\n\r\n\tTimeout time.Duration\r\n\tTTL     time.Duration\r\n\r\n\tNotes string\r\n}\r\n```\r\n\r\nServiceDefinition takes a slice of CheckTypes rather than full blown HealthDefinitions so you don't get fields like ID and Name. You could add ID and/or Name to CheckType and I think that would solve this but then you might as well just have a slice of HealthDefinitions inside of ServiceDefinition. The way I am currently avoiding this problem is just defining a Service in one file and then in a separate file defining a list of checks that are all associated with that one service which makes config management easy. It's not as elegant as what @blalor suggested but it works. "}}