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

Support recheck interval for health check #6550

Open
mr-manuel opened this issue Mar 22, 2020 · 18 comments · May be fixed by #10610
Open

Support recheck interval for health check #6550

mr-manuel opened this issue Mar 22, 2020 · 18 comments · May be fixed by #10610
Assignees
Labels
area/healthcheck contributor/good-first-issue contributor/wanted Participation from an external contributor is highly requested kind/enhancement a new or improved feature. priority/P3 maybe
Projects

Comments

@mr-manuel
Copy link

mr-manuel commented Mar 22, 2020

Do you want to request a feature or report a bug?

Feature

What did you expect to see?

It would be great to see this features in the health check:

1. Be able to select the HTTP method (GET, POST, HEAD, ...) which the health check is using #9138

  1. Be able to set a different retry interval on check failure (like on Nagios).
    E.g.: The health check interval is set to 300s, but when the check fails, then the retry interval is 15s.
@ldez ldez added area/healthcheck kind/proposal a proposal that needs to be discussed. and removed status/0-needs-triage labels Mar 23, 2020
@ldez ldez added this to issues in v2 via automation Mar 23, 2020
@dsseng

This comment was marked as outdated.

@ldez
Copy link
Member

ldez commented Mar 26, 2020

For now we prefer to wait and see who want that and have concretes use cases.

@wighawag
Copy link

wighawag commented Jan 9, 2022

I am interested in this feature. My use case is the following:
I have a backend whose health reporting is done through graphql and the response status is 200 even when he graphql response contains an unhealthy state.

If there could be a way to specify a certain parsing for health check I could reuse that graphql response.

An alternative would be to configure health check to go through a different backend that would perform the parsing like

healthcheck:
 url: http://healthchecker

@gfonseca-tc
Copy link

I have a use case where my service only responds to POST resquest with a specific body. In order to check it healthiness I need to be able to send POST request to the endpoint. I'm able to do that using Nomad check but not with traefik.

@Dragnell87

This comment was marked as off-topic.

@ddtmachado

This comment was marked as off-topic.

@Dragnell87

This comment was marked as off-topic.

@tomMoulard tomMoulard added kind/enhancement a new or improved feature. priority/P3 maybe and removed kind/proposal a proposal that needs to be discussed. labels Jun 29, 2022
@rtribotte rtribotte changed the title Feature request - health check HTTP method and recheck interval on failure Support recheck interval for health check Jun 29, 2022
@rtribotte
Copy link
Member

Hello,

Thanks for suggesting this, we also think that the support for a recheck interval could be a great addition.

Unfortunately, this issue is not on our roadmap, but anyone willing to contribute is more than welcome. In case anyone is interested but unsure on how to proceed check out our contributing guide.

@Muscaw
Copy link

Muscaw commented Oct 4, 2023

Hey,
I would be interested in working on this feature. I'll contribute a PR in the following days for it :)

@sswastik02
Copy link

Is this issue still valid ?

@mmatur mmatur self-assigned this Apr 2, 2024
@mmatur
Copy link
Member

mmatur commented Apr 2, 2024

Hello,

@sswastik02 yes it still valid we are looking for some from the community on this one.
@Muscaw do you have some time to propose your implementation?

@mmatur mmatur added the contributor/wanted Participation from an external contributor is highly requested label Apr 2, 2024
@sswastik02
Copy link

sswastik02 commented Apr 2, 2024

Hi @mmatur,
I would like to work on this issue. If not already implemented by @Muscaw.

@Muscaw
Copy link

Muscaw commented Apr 2, 2024

Hi @mmatur,

If it's okay with @Muscaw, I would like to work on this issue.

Hi @mmatur @sswastik02 ,

I unfortunately did not have enough free time to complete my PR. @sswastik02 feel free to work on it 👍

@sswastik02
Copy link

Hi @mmatur and @Muscaw,

In an effort to better understand this issue, I delved into the documentation provided here. As someone relatively new to this, I find that many of the functionalities outlined in the documentation appear to be relevant to our current issue. However, I'm struggling to identify the specific area I should focus on or where to begin my work.

Could you kindly offer some guidance or provide a starting point for me to look into? Any advice would be greatly appreciated.

Thank you in advance.

@sswastik02
Copy link

Hello, @mmatur
This here is where I think the patch should be implemented. When calls to function executeHealthCheck fail, the plan is to incorporate (perhaps another) ticker . Can you please tell whether I'm heading in the correct direction?

@sswastik02
Copy link

sswastik02 commented Apr 11, 2024

Hi @mmatur ,
I would like to propose this plan for this issue, steps which include

  1. Implement GetStatus Function: Introduce a GetStatus function similar to the one found in this example. This function will enable the retrieval of the status of child services.

  2. Introduce recheck Field: Add a new field named recheck in ServerHealthChecker to store the duration of the recheck interval. This will allow for configuring how frequently the health checks should be performed when the service returns an unhealthy status.

  3. Utilize GetStatus Function: Modify the logic in healthcheck.go to utilize the GetStatus function. This will enable the healthcheck function to check if the current status is new and reset the ticker accordingly.

If the proposed plan looks good, I will proceed with implementing these changes and submit a pull request accordingly.

Your feedback and suggestions on this proposal are highly appreciated.

@rtribotte rtribotte self-assigned this Apr 12, 2024
@rtribotte
Copy link
Member

Hello @sswastik02,

Thanks for sharing and explaining the approach, sure, please let's open the PR!

@rtribotte rtribotte removed their assignment Apr 12, 2024
@sswastik02
Copy link

Hi @rtribotte,
Thank you very much for your validation of my approach. I will go ahead and create a pull request shortly.

BR

sswastik02 added a commit to sswastik02/traefik that referenced this issue Apr 12, 2024
closes traefik#6550

Signed-off-by: sswastik02 <40518186+sswastik02@users.noreply.github.com>
sswastik02 added a commit to sswastik02/traefik that referenced this issue May 17, 2024
closes traefik#6550

Signed-off-by: sswastik02 <40518186+sswastik02@users.noreply.github.com>
sswastik02 added a commit to sswastik02/traefik that referenced this issue May 18, 2024
closes traefik#6550

Signed-off-by: sswastik02 <40518186+sswastik02@users.noreply.github.com>
sswastik02 added a commit to sswastik02/traefik that referenced this issue May 18, 2024
closes traefik#6550

Signed-off-by: sswastik02 <40518186+sswastik02@users.noreply.github.com>
sswastik02 added a commit to sswastik02/traefik that referenced this issue May 19, 2024
closes traefik#6550

Signed-off-by: sswastik02 <40518186+sswastik02@users.noreply.github.com>
sswastik02 added a commit to sswastik02/traefik that referenced this issue May 19, 2024
closes traefik#6550

Signed-off-by: sswastik02 <40518186+sswastik02@users.noreply.github.com>
sswastik02 added a commit to sswastik02/traefik that referenced this issue May 19, 2024
closes traefik#6550

Signed-off-by: sswastik02 <40518186+sswastik02@users.noreply.github.com>
sswastik02 added a commit to sswastik02/traefik that referenced this issue May 22, 2024
closes traefik#6550

Signed-off-by: sswastik02 <40518186+sswastik02@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/healthcheck contributor/good-first-issue contributor/wanted Participation from an external contributor is highly requested kind/enhancement a new or improved feature. priority/P3 maybe
Projects
No open projects
v2
issues
Development

Successfully merging a pull request may close this issue.