Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zalando/failsafe-actuator
Endpoint library for the failsafe framework
https://github.com/zalando/failsafe-actuator
circuit-breaker failsafe monitor monitoring spring-boot
Last synced: about 2 months ago
JSON representation
Endpoint library for the failsafe framework
- Host: GitHub
- URL: https://github.com/zalando/failsafe-actuator
- Owner: zalando
- License: mit
- Archived: true
- Created: 2016-07-01T11:28:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-03-31T18:38:46.000Z (over 2 years ago)
- Last Synced: 2024-07-12T17:19:55.178Z (5 months ago)
- Topics: circuit-breaker, failsafe, monitor, monitoring, spring-boot
- Language: Java
- Size: 308 KB
- Stars: 52
- Watchers: 12
- Forks: 11
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-java - Failsafe Actuator - Out of the box monitoring of Failsafe Circuit Breaker in Spring-Boot environment. (Projects / Monitoring)
README
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/97639870e76546cab6fd2597c583c0b1)](https://www.codacy.com/app/MALPI/failsafe-actuator?utm_source=github.com&utm_medium=referral&utm_content=zalando-incubator/failsafe-actuator&utm_campaign=badger)
[![Build Status](https://travis-ci.org/zalando/failsafe-actuator.svg?branch=master)](https://travis-ci.org/zalando/failsafe-actuator)
[![Maven Central](https://img.shields.io/maven-central/v/org.zalando/failsafe-actuator.svg)](https://maven-badges.herokuapp.com/maven-central/org.zalando/failsafe-actuator)# Failsafe Actuator
**Failsafe Actuator** is a Java library that provides a simple monitoring interface for [Spring Boot](https://projects.spring.io/spring-boot/)
applications that use the [Failsafe](https://github.com/jhalterman/failsafe) library.
Using Failsafe Actuator will readily expose the state of your [Circuit Breakers](http://martinfowler.com/bliki/CircuitBreaker.html) (closed, open, half-open)
to your Spring Actuator endpoint without additional effort.## Core Technical Concepts/Inspiration
Failsafe Actuator supports Spring's dependency injection to make it easier to use *Failsafe*.
It allows you to monitor the state of your Circuit Breakers so that, whenever a third party that your app relies upon
suddenly becomes unavailable, you can discover it immediately and take action. This is essential for applications used in production.## Development Status/Project Roadmap
This library is currently under development and used in production at [Zalando](https://jobs.zalando.com/tech/).Find more details about our development plans in the [Issues Tracker](https://github.com/zalando-incubator/failsafe-actuator/issues).
We're always [looking for contributors](https://github.com/zalando-incubator/failsafe-actuator/blob/master/CONTRIBUTIONS.md),
so if you find an interesting "Help Wanted" issue then please drop us a line in the related issue to claim it and begin working.Unless you explicitly state otherwise in advance, any non trivial contribution intentionally submitted for inclusion in this project by you to the steward of this repository (Zalando SE, Berlin) shall be under the terms and conditions of the MIT License, without any additional copyright information, terms or conditions.
## Getting Started
### Dependencies/Requirements
* Java 8
* [Spring Boot 2](http://projects.spring.io/spring-boot/)
* [Failsafe](https://github.com/jhalterman/failsafe)### Running/Using
To use Failsafe Actuator, add the following dependency to your project:
**Gradle:**
```groovy
compile("org.zalando:failsafe-actuator:${FAILSAFE-ACTUATOR-VERSION}")
```**Maven:**
```xmlorg.zalando
failsafe-actuator
${failsafe-actuator.version}```
Create your `CircuitBreaker` by defining them as a `Bean`.
```java
@Configuration
public class CircuitBreakerConfiguration {
@Bean
public CircuitBreaker myBreaker() {
return new CircuitBreaker();
}
}
```You can use and configure the created `CircuitBreaker` by autowiring it in the class where it should be used.
```java
@Component
public class MyBean {
@Autowired
private CircuitBreaker myBreaker;
}
```That's it. By calling the [endpoint](http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html) via _**http://${yourAddress}/actuator/circuitbreakers**_.
you will get a response which looks like the following:```http
GET /actuator/circuitbreakersHTTP/1.1 200
Content-Type: application/json{
"myBreaker": {
"state": "OPEN"
},
"otherBreaker": {
"state": "CLOSED"
}
}
```Individual circuit breakers can be requested via `/acutuator/circuitbreakers/{name}`:
```http
GET /actuator/circuitbreakers/myBreakerHTTP/1.1 200
Content-Type: application/json{
"state": "OPEN"
}
```You can even modify the circuit breaker state and manually open or close them:
```http
POST /actuator/circuitbreakers/myBreaker
Content-Type: application/json{
"state": "CLOSED"
}
```## Example usage
To see a complete example on how to use the library take a look at the
[Sample Application](https://github.com/zalando/failsafe-actuator/blob/master/src/test/java/org/zalando/actuate/failsafe/SampleApplication.java).
It starts a [Rest Controller](https://github.com/zalando/failsafe-actuator/blob/master/src/test/java/org/zalando/actuate/failsafe/SampleController.java)
that shows how to autowire `CircuitBreaker` into your application
and configure them.## How to build on your own
In order to build the JAR on your own run the following command:
```bash
mvn clean install
```## License
This code is released under the MIT license. See [License](LICENSE).