feat(badge): Implement UP/DOWN status badge (#291)

* Implement status badge endpoint

* Update integration tests for status badge generation

* Add status badge in the UI

* Update static assets

* Update README with status badge description

* Rename constants to pascal-case

* Check for success of the endpoint conditions

* Rename status badge to health badge
This commit is contained in:
asymness
2022-06-20 22:59:45 +05:00
committed by GitHub
parent 0193a200b8
commit a3e35c862c
8 changed files with 170 additions and 6 deletions

View File

@ -78,6 +78,7 @@ Have any feedback or want to share your good/bad experience with Gatus? Feel fre
- [Exposing Gatus on a custom port](#exposing-gatus-on-a-custom-port)
- [Badges](#badges)
- [Uptime](#uptime)
- [Health](#health)
- [Response time](#response-time)
- [API](#api)
- [High level design overview](#high-level-design-overview)
@ -1407,6 +1408,23 @@ Example:
If you'd like to see a visual example of each badge available, you can simply navigate to the endpoint's detail page.
#### Health
![Health](https://status.twin.sh/api/v1/endpoints/core_blog-external/health/badge.svg)
The path to generate a badge is the following:
```
/api/v1/endpoints/{key}/health/badge.svg
```
Where:
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,` and `.` replaced by `-`.
For instance, if you want the current status of the endpoint `frontend` in the group `core`,
the URL would look like this:
```
https://example.com/api/v1/endpoints/core_frontend/health/badge.svg
```
#### Response time
![Response time 1h](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/1h/badge.svg)
![Response time 24h](https://status.twin.sh/api/v1/endpoints/core_blog-external/response-times/24h/badge.svg)