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

Consul health check path is not working #1062

Closed
sergiojrdotnet opened this issue Nov 28, 2022 · 3 comments
Closed

Consul health check path is not working #1062

sergiojrdotnet opened this issue Nov 28, 2022 · 3 comments
Labels
Component/Discovery Issues related to Steeltoe Service Discovery ReleaseLine/3.x Identified as a feature/fix for the 3.x release line ReleaseLine/4.x Identified as a feature/fix for the 4.x release line Status/works-as-designed The code works as designed Type/bug Something isn't working

Comments

@sergiojrdotnet
Copy link

sergiojrdotnet commented Nov 28, 2022

Describe the bug

Consul health check path is not working

Steps to reproduce

Steps to reproduce the behavior:

  1. Add Consul:Discovery:HealthCheckPath configuration

image

Expected behavior

Health check endpoint should be added to service instance on consul portal but it only shows the default TTL check.

image

Environment

  • Steeltoe Version: NuGet package Steeltoe.Discovery.Consul 3.2.1
  • Platform: Local test / Azure
  • OS: Windows
  • .NET Version: .NET 5
@sergiojrdotnet sergiojrdotnet added the Type/bug Something isn't working label Nov 28, 2022
@TimHess TimHess added Component/Discovery Issues related to Steeltoe Service Discovery ReleaseLine/3.x Identified as a feature/fix for the 3.x release line ReleaseLine/4.x Identified as a feature/fix for the 4.x release line labels Jan 17, 2023
@TimHess
Copy link
Member

TimHess commented Jan 17, 2023

Hi @sergiojrdotnet,

Thank you for reporting the bug, and I'm sorry for the delayed response! I've done some basic testing and can confirm that I'm seeing the same results even with an updated Consul nuget package and also with Consul server versions as old as 1.8, so it does not seem likely to me that this particular feature ever worked completely correctly. Unfortunately, the core Steeltoe team has a lot of work in flight already, so aside from confirming the bug report I'm not sure when we'll be able to make progress on a fix. Is this an issue important enough to you that you would consider tracking it down and contributing a fix?

@TimHess TimHess added the help wanted Looking for help from community for a resolution label Jan 17, 2023
@TimHess
Copy link
Member

TimHess commented Jan 18, 2023

I've had a glance at the code and found this block (IsHeartBeatEnabled is defined here) is the reason that setting isn't working as expected.

Adding this to appsettings looks weird and wrong, but (as a quick hack) does appear to result in an enabled HTTP health check on the custom path:

  "Consul": {
    "Discovery": {
      "HealthCheckPath": "/my/custom/health",
      "HeartBeat": {
        "Enabled": false
      }
    }
  }

@TimHess
Copy link
Member

TimHess commented Jan 17, 2024

I've had a glance at the code and found this block (IsHeartBeatEnabled is defined here) is the reason that setting isn't working as expected.

Adding this to appsettings looks weird and wrong, but (as a quick hack) does appear to result in an enabled HTTP health check on the custom path:

  "Consul": {
    "Discovery": {
      "HealthCheckPath": "/my/custom/health",
      "HeartBeat": {
        "Enabled": false
      }
    }
  }

It turns out our version of "As expected" was based on a assumptions due to missing detail in the documentation around TTL/HeartBeat checks and HTTP/Health Checks. The requirement to disable HeartBeat is actually "as designed" and not a hack.

I've added an issue to improve the docs and open to more input on improving how this works - especially with #1245 still open

@TimHess TimHess added Status/works-as-designed The code works as designed and removed help wanted Looking for help from community for a resolution labels Jan 18, 2024
@TimHess TimHess closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component/Discovery Issues related to Steeltoe Service Discovery ReleaseLine/3.x Identified as a feature/fix for the 3.x release line ReleaseLine/4.x Identified as a feature/fix for the 4.x release line Status/works-as-designed The code works as designed Type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants