Search code examples
scaladockersbtmesosmarathon

Marathon Healthcheck for Dockerized Scala Application via SBT


I am using Marathon and Mesos. My applications are based on Scala and I am using SBT docker plugin to dockerize the application and to deploy to Marathon. The applications are asynchronous (Queue Based) and not invoked via HTTP. How do I perform healthcheck for Asynchronous applications and is it possible to leverage SBT Scalatest here. The application is dockerized, so how do we invoke Scalatest inside a dockerized app. Any thoughts ?


Solution

  • You can use Command HealthCheck and execute your custom command.

    Think if you really need a health-check and what it will tell you. Avoid health checks that eat resources better expose an endpoint that will monitor thread pools, timeouts e.t.c. and returns unhealthy when something is really wrong. In other cases, you should configure your metrics to notify you that something bad happens.

    Process health checking (“is this binary responding at all?”) and service health checking (“is this binary able to respond to this class of requests right now?”) are two conceptually distinct operations. Process health checking is relevant to the cluster scheduler, whereas service health checking is relevant to the load balancer. Clearly distinguishing between the two types of health checks can help avoid this scenario.