Questions tagged [health-check]

A status of a service and any services it depends on. The health check can be used to monitor the service and is usually accessed via a request to a specific route on the server.

What is a health check?

Health checks are a way to know the status of the service we are monitoring.

This status can be affected by several factors:

  1. The internal state of the service
  2. The external services the service uses (such as external APIs, message brokers)
  3. Hardware dependencies (such as storage or network problems)

Identifying what problems exist in real-time can greatly improve the day-to-day management of the service, and can help track down issues that result from it's downgraded performance, as well as provide observability for a wide array of services.

What questions should contain this tag?

  1. Questions about the proper use of health-checks
  2. Questions about specific implementations of health-checks
  3. Questions about real-time monitoring using health-checks
  4. Questions about recommended health check for specific dependencies
421 questions
31
votes
3 answers

Asp.net core healthchecks randomly fails with TaskCanceledException or OperationCanceledException

I've implemented healthchecks in my asp.net core application. One healthcheck does 2 checks - DbContext connection and custom one that checks NpgsqlConnection. Everything works fine in over 99% of cases. Occasionally healthcheck fails throwing…
Maciej Pszczolinski
  • 1,623
  • 1
  • 19
  • 38
19
votes
4 answers

Safe ways to specify postgres parameters for healthchecks in docker compose

I'm using secrets to manage username, password, and dbname with a Docker stack using Postgres as a DB. I now want to use the healthcheck feature that Docker provides. docker-compose.yml x-db-secrets: &db_secrets - psql_user - psql_pass -…
logicOnAbstractions
  • 2,178
  • 4
  • 25
  • 37
17
votes
4 answers

How to do a health check of a Spring Boot application running in a Docker Container?

I am running a Spring Boot application within a Docker container, using the Docker file to start the application within the container. How can I check the health of the Spring Boot application within the container? If the container stops or the…
11
votes
2 answers

docker-compose healthcheck retry frequency != interval

I recently set up healthchecks in my docker-compose config. It is doing great and I like it. Here's a typical example: services: app: healthcheck: test: curl -sS http://127.0.0.1:4000 || exit 1 interval: 5s timeout: 3s …
Augustin Riedinger
  • 20,909
  • 29
  • 133
  • 206
10
votes
3 answers

What happens to a Docker Container when HEALTHCHECK fails

The docker docs say what a HEALTHCHECK instruction is and how to check the health of a container. But I am not able to figure out what happens when healthcheck fails. Like will the container be restarted or stoped or any of these two as per user…
samshers
  • 1
  • 6
  • 37
  • 84
9
votes
1 answer

speed up docker healthcheck containers

I'd like to speed up the container startup time but my healthcheck is not allowing me. Let's say I'm having this healthcheck HEALTHCHECK --interval=300s --timeout=5s --start-period=5s --retries=3 CMD \ curl http://localhost: > /dev/null ||…
Astin Gengo
  • 379
  • 3
  • 17
9
votes
3 answers

How to exclude redis check in spring actuator health

Service health check api response 503 when redis is down. { "status": "DOWN", "details": { "diskSpace": { "status": "UP", "details": { "total": 250790436864, "free":…
9
votes
2 answers

Simple healthcheck endpoint in nginx server container

I have a docker container running with nginx server. I want to provide a rest-interface/endpoint to check the health of the server and container. E.g. GET http://container.com/health/ which delivers "true"/OK or "false"/NOK. What is the simplest…
m19v
  • 1,800
  • 4
  • 11
  • 26
8
votes
3 answers

How to create a custom health check for Prisma with @nestjs/terminus?

Since @nestjs/terminus doesn't provide a health check for Prisma, I'm trying to create it based on their Mongoose health check. When I try: import * as Prisma from 'prisma'; ... ... private getContextConnection(): any | null { const { …
zedian
  • 397
  • 5
  • 16
7
votes
1 answer

Usehealthchecks vs Maphealthchecks

I've looked around from place to place but I am assuming one is an older way of doing things, but is there a more deeper difference to adding Health Check Endpoints to the middleware? In Startup.Configure().. app.UseEndpoints(endpoints => { …
Zach Hutchins
  • 801
  • 1
  • 12
  • 16
7
votes
1 answer

Health check, ASP.NET Web API

In my work I was asked to implement health checks into an ASP.NET Web API 2 written in C#. I have searched but all the documentation is for ASP.NET Core and its implementation, does anyone know how to implement health check featurs in the classic /…
6
votes
3 answers

AWS App Runner "Create Failed" on health check

I'm creating my first app on AWS App Runner. I have a simple nginx Docker image that works locally by serving html on localhost:8080. When I try to deploy it, the result is "Create Failed". Upon digging into the CloudWatch logs, I see that the…
6
votes
1 answer

Using HealthCheckUI fails with exception "No service for type 'HealthChecks.UI.Core.Data.HealthChecksDb' has been registered."

I am using a .NET Core 3.1 Web app. The following packages are installed: Inside…
Marco Siffert
  • 535
  • 1
  • 6
  • 22
6
votes
3 answers

ASP.NET Core Health Checks: Returning pre-evaluated results

I'm evaluating the use of Microsoft Health Checks to improve routing of our internal load balancer. So far I'm very happy with the functionality provided by this feature and the community around it. However there's one thing I did not find yet and…
Waescher
  • 5,361
  • 3
  • 34
  • 51
6
votes
1 answer

How to automatically restart Heroku dynos when application is failing?

Platforms such as Kubernetes have support for liveness and readiness probes: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes Basically, the (web) application needs to provide a specific http…
Andy Verbunt
  • 387
  • 1
  • 4
  • 13
1
2 3
27 28