akka-http-health


License

License

MIT
Categories

Categories

Akka Container Microservices Reactive libraries
GroupId

GroupId

io.github.lhotari
ArtifactId

ArtifactId

akka-http-health_2.13
Last Version

Last Version

1.0.9
Release Date

Release Date

Type

Type

jar
Description

Description

akka-http-health
akka-http-health
Project URL

Project URL

https://github.com/lhotari/akka-http-health
Project Organization

Project Organization

io.github.lhotari
Source Code Management

Source Code Management

https://github.com/lhotari/akka-http-health

Download akka-http-health_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.lhotari/akka-http-health_2.13/ -->
<dependency>
    <groupId>io.github.lhotari</groupId>
    <artifactId>akka-http-health_2.13</artifactId>
    <version>1.0.9</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.lhotari/akka-http-health_2.13/
implementation 'io.github.lhotari:akka-http-health_2.13:1.0.9'
// https://jarcasting.com/artifacts/io.github.lhotari/akka-http-health_2.13/
implementation ("io.github.lhotari:akka-http-health_2.13:1.0.9")
'io.github.lhotari:akka-http-health_2.13:jar:1.0.9'
<dependency org="io.github.lhotari" name="akka-http-health_2.13" rev="1.0.9">
  <artifact name="akka-http-health_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.lhotari', module='akka-http-health_2.13', version='1.0.9')
)
libraryDependencies += "io.github.lhotari" % "akka-http-health_2.13" % "1.0.9"
[io.github.lhotari/akka-http-health_2.13 "1.0.9"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.13.1
com.typesafe.akka : akka-stream_2.13 jar 2.5.29
com.typesafe.akka : akka-http_2.13 jar 10.1.11
org.scala-lang.modules : scala-collection-compat_2.13 jar 2.1.4

test (6)

Group / Artifact Type Version
com.typesafe.akka : akka-http-testkit_2.13 jar 10.1.11
com.typesafe.akka : akka-stream-testkit_2.13 jar 2.5.29
org.scalatest : scalatest_2.13 jar 3.0.8
org.mockito : mockito-all jar 1.10.19
com.google.guava : guava jar 21.0
commons-io : commons-io jar 2.5

Project Modules

There are no modules declared in this project.

Build Status

akka-http-health

Library for adding /health endpoint checks for Akka Http applications.

Provides a default /health endpoint that checks:

  • that the memory state is healthy
  • that there is enough available disk space

A load balancer like AWS ELB can be configured to call the health endpoint and it could decide to destroy any unhealthy instances.

This is not a metrics library. Please take a look at Kamon if you are looking for a metrics and tracing library that's well suited for akka-http applications.

Getting Started

Adding the dependency

sbt 0.13.6+

resolvers += Resolver.jcenterRepo
libraryDependencies += "io.github.lhotari" %% "akka-http-health" % "1.0.9"

The library gets published on bintray/jcenter and synchronized from there to Sonatype OSS for staging to Maven central (starting since version 1.0.7). It's recommended to use the jcenter repository since new releases will be available there instantly.

Simple use

The route instance created by calling io.github.lhotari.akka.http.health.HealthEndpoint.createDefaultHealthRoute() will handle /health with default settings. Append that route instance to the desired route binding.

Because of security concerns, it is generally adviced to serve the health endpoint on a separate port that isn't exposed to the public.

Advanced use

For customization, use the trait io.github.lhotari.akka.http.health.HealthEndpoint and override protected methods. Calling the createHealthRoute() method creates the route instance.

Contributing

Pull requests are welcome.

Some basic guidelines:

  • A few unit tests would help a lot as well - someone has to do that before the PR gets merged.
  • Please rebase the pull request branch against the current master.
  • When writing a commit message please follow these conventions.
  • If you are fixing an existing issue please add Fixes gh-XXXX at the end of the commit message (where XXXX is the issue number).
  • Add the license header to each source code file (see existing source code files for an example)

Contact

Lari Hotari

License

The library is Open Source Software released under the MIT license. See the LICENSE file for details.

Versions

Version
1.0.9