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

check id and names not recognized when specified in a service definition json file #3223

Closed
stephenranjit opened this issue Jul 4, 2017 · 4 comments
Assignees

Comments

@stephenranjit
Copy link

consul version for both Client and Server

Client: consul --version Consul v0.8.3 Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
Server: consul --version Consul v0.8.3 Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

consul info for both Client and Server

Client:
consul info
agent:
check_monitors = 3
check_ttls = 0
checks = 3
services = 1
build:
prerelease =
revision = ea2a82b
version = 0.8.3
consul:
bootstrap = false
known_datacenters = 1
leader = true
leader_addr = :8300
server = true
raft:
applied_index = 1927327
commit_index = 1927327
fsm_pending = 0
last_contact = 0
last_log_index = 1927327
last_log_term = 12
last_snapshot_index = 1925522
last_snapshot_term = 9
latest_configuration = [{Suffrage:Voter ID: :8300 Address: :8300} {Suffrage:Voter ID: :8300 Address: :8300} {Suffrage:Voter ID: 09:8300 Address: 09:8300}]
latest_configuration_index = 1915820
num_peers = 2
protocol_version = 2
protocol_version_max = 3
protocol_version_min = 0
snapshot_version_max = 1
snapshot_version_min = 0
state = Leader
term = 12
runtime:
arch = amd64
cpu_count = 40
goroutines = 146
max_procs = 40
os = linux
version = go1.8.1
serf_lan:
encrypted = false
event_queue = 0
event_time = 7
failed = 1
health_score = 0
intent_queue = 0
left = 0
member_time = 1919
members = 3
query_queue = 0
query_time = 1
serf_wan:
encrypted = false
event_queue = 0
event_time = 1
failed = 1
health_score = 0
intent_queue = 0
left = 0
member_time = 961
members = 3
query_queue = 0
query_time = 1

Operating system and Environment details

Red Hat Enterprise Linux Server release 6.4 (Santiago)

Description of the Issue (and unexpected/desired result)

my service config looks like this

{
"service": {
    "name": "dkron",
    "tags": ["dkron"],
    "checks": [
        {
            "id": "check-dkron",
            "script": "check_procs -c 1:1 -C dkron",
            "timeout": "20s",
            "interval": "1m"
        },
        {
            "id": "check-load",
            "script": "check_load -r -w 50,50,50 -c 80,80,80",
            "interval": "1m"
        }
    ]
  }
}

consul doesn't recognize the check ids instead it shows "service:dkron:1" and "service:dkron:2". i want it to simply show "check-dkron" or atleast "service:dkron:check-dkron"

if i put these checks in a separate json file they work just fine. what am i doing wrong?

@magiconair
Copy link
Contributor

try checkID instead of id when embedding the checks with the service. we have an issue open which should consolidate this: #3179

@stephenranjit
Copy link
Author

so adding checkID didn't work. had the same problem but i added ServiceID and ServiceName to the checks in a separate config and it worked. I now have separate checks for each service. hopefully the checkID fix should resolve this issue in future releases.

@magiconair
Copy link
Contributor

consul 1.0 will allow you to set a check id via the id field but you need to ensure that they are unique per agent.

@magiconair magiconair self-assigned this Oct 8, 2017
@magiconair
Copy link
Contributor

This works now in consul 1.0.

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

No branches or pull requests

2 participants