feat(api): Expose uptime data as text via API (#758)
* Expose Raw Uptime Data via API Signed-off-by: James Hillyard <james.hillyard@payara.fish> * Add Test for Raw Uptime Data API Endpoint Signed-off-by: James Hillyard <james.hillyard@payara.fish> * Document Raw Uptime Data API Endpoint Signed-off-by: James Hillyard <james.hillyard@payara.fish> * Fix Test after #759 Core Refactor Signed-off-by: James Hillyard <james.hillyard@payara.fish> * Update Raw Data Content Type Signed-off-by: James Hillyard <james.hillyard@payara.fish> * Support 30d Data from Raw Uptime Endpoint Signed-off-by: James Hillyard <james.hillyard@payara.fish> * Update README.md * Update README.md --------- Signed-off-by: James Hillyard <james.hillyard@payara.fish> Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
18
README.md
18
README.md
@ -119,6 +119,7 @@ Have any feedback or questions? [Create a discussion](https://github.com/TwiN/ga
|
||||
- [Response time](#response-time)
|
||||
- [How to change the color thresholds of the response time badge](#how-to-change-the-color-thresholds-of-the-response-time-badge)
|
||||
- [API](#api)
|
||||
- [Raw Data](#raw-data)
|
||||
- [Installing as binary](#installing-as-binary)
|
||||
- [High level design overview](#high-level-design-overview)
|
||||
|
||||
@ -2404,6 +2405,23 @@ Gzip compression will be used if the `Accept-Encoding` HTTP header contains `gzi
|
||||
The API will return a JSON payload with the `Content-Type` response header set to `application/json`.
|
||||
No such header is required to query the API.
|
||||
|
||||
#### Raw Data
|
||||
Gatus exposes the raw data for one of your monitored endpoints.
|
||||
This allows you to track and aggregate data in your own applications for monitored endpoints. For instance if you want to track uptime for a period longer than 7 days.
|
||||
|
||||
##### Uptime
|
||||
The path to get raw uptime data for an endpoint is:
|
||||
```
|
||||
/api/v1/endpoints/{key}/uptimes/{duration}
|
||||
```
|
||||
Where:
|
||||
- `{duration}` is `30d` (alpha), `7d`, `24h` or `1h`
|
||||
- `{key}` has the pattern `<GROUP_NAME>_<ENDPOINT_NAME>` in which both variables have ` `, `/`, `_`, `,` and `.` replaced by `-`.
|
||||
|
||||
For instance, if you want the raw uptime data for the last 24 hours from the endpoint `frontend` in the group `core`, the URL would look like this:
|
||||
```
|
||||
https://example.com/api/v1/endpoints/core_frontend/uptimes/24h
|
||||
```
|
||||
|
||||
### Installing as binary
|
||||
You can download Gatus as a binary using the following command:
|
||||
|
Reference in New Issue
Block a user