Skip to content
This repository was archived by the owner on Aug 17, 2021. It is now read-only.

Library to help applications report their health in a consistent manner

Notifications You must be signed in to change notification settings

ShellRechargeSolutionsEU/status-checks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library to add consistent checks on application health

Modules

core

contains core functionality

The type of a check is

type Check = () => Future[Result]

you can use it by extending your code with the StatusCheck trait or by using the StatusCheck object

an example check is

val checks:Future[Results] = Checks("my.app.newmotion.com")
    .internal("db.psql.my-app", Importance.Critical, checkDb)
    .internal("actor-system", Importance.Critical, checkActorSystem
    .external("rabbitmq", Importance.Minor, checkRabbitMq)
    .external("some-other-service.newmotion.com", Importance.Major, checkSomeOtherService)
    .run()
    
def checkDb() = () => {
          db.run(sqlu"select 1").map(r => Result(r.equals(1), Map()))
        }   

the last argument in the Result is a Map[String, String] to allow passing on extra information like, response times etc

akka_http_spray_json

uses the core module

Routes for /status and /heartbeat

    def routes: Route = normalRoutes ++ statusRoutes(checks) 

other combinations of servers and json serializers

coming soon

About

Library to help applications report their health in a consistent manner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages