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

Nomad Service Catalog should have a filter or metadata for health status #15603

Open
mr-karan opened this issue Dec 21, 2022 · 3 comments
Open
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/service-discovery/nomad theme/service-discovery type/enhancement

Comments

@mr-karan
Copy link
Contributor

Proposal

Currently, I am querying the list of Nomad Services using consul-template Nomad functions. I couldn't find a way to filter only the list of healthy services.

image
image

However, when I query the list of nomad services for this namespace, I can find these services here and it doesn't have any metadata whether the healthcheck failed or not:

[
    {
        "Address": "192.168.29.76",
        "AllocID": "4565fd09-ae36-06c7-229a-bd685ea5b8f4",
        "CreateIndex": 2510,
        "Datacenter": "dc1",
        "ID": "_nomad-task-4565fd09-ae36-06c7-229a-bd685ea5b8f4-web-doggo-web-http",
        "JobID": "doggo",
        "ModifyIndex": 2510,
        "Namespace": "default",
        "NodeID": "987413db-db5f-0267-caff-cc82086234f0",
        "Port": 27159,
        "ServiceName": "doggo-web",
        "Tags": [
            "doggo",
            "web"
        ]
    },
    {
        "Address": "192.168.29.76",
        "AllocID": "52efad7f-6b99-de8f-50b3-9e4358ea7c3c",
        "CreateIndex": 2477,
        "Datacenter": "dc1",
        "ID": "_nomad-task-52efad7f-6b99-de8f-50b3-9e4358ea7c3c-web-doggo-web-http",
        "JobID": "doggo",
        "ModifyIndex": 2477,
        "Namespace": "default",
        "NodeID": "987413db-db5f-0267-caff-cc82086234f0",
        "Port": 28421,
        "ServiceName": "doggo-web",
        "Tags": [
            "doggo",
            "web"
        ]
    },
    {
        "Address": "192.168.29.76",
        "AllocID": "fed569fb-3dac-8ed5-2c0c-7216c0a00ae9",
        "CreateIndex": 2524,
        "Datacenter": "dc1",
        "ID": "_nomad-task-fed569fb-3dac-8ed5-2c0c-7216c0a00ae9-web-doggo-web-http",
        "JobID": "doggo",
        "ModifyIndex": 2524,
        "Namespace": "default",
        "NodeID": "987413db-db5f-0267-caff-cc82086234f0",
        "Port": 24021,
        "ServiceName": "doggo-web",
        "Tags": [
            "doggo",
            "web"
        ]
    }
]

Use-cases

When using NGINX or similar proxy, it's useful to only filter the upstream servers which are healthy. This will help these proxies to not send the request to the upstream servers where health checks are failing.

Attempted Solutions

Couldn't find a workaround

@jrasell
Copy link
Member

jrasell commented Jan 3, 2023

Hi @mr-karan and thanks for raising, what I agree, would be a useful addition to the Nomad service discovery feature. To provide context, this is a known and designed current limitation as the health check state is only stored on the Nomad client that is performing the checking.

@jrasell jrasell added stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/service-discovery theme/service-discovery/nomad labels Jan 3, 2023
@devminded
Copy link

Related to prometheus/prometheus#11775

@konnextv
Copy link

Nomad newbie here, this peculiarity should definitely be mentioned in the template docs. I thought it is obvious that only healthy service instances are included in nomadService and wasted hours searching the cause of my problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/service-discovery/nomad theme/service-discovery type/enhancement
Projects
Status: Needs Roadmapping
Development

No branches or pull requests

4 participants