From 732dd728810596e852713cd044004fb986758d05 Mon Sep 17 00:00:00 2001 From: Simon Ehrenstein <stu200776@mail.uni-kiel.de> Date: Fri, 16 Apr 2021 09:45:41 +0000 Subject: [PATCH] Add Slo Checker Api Documentation --- slope-evaluator/README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/slope-evaluator/README.md b/slope-evaluator/README.md index 25c02b42e..69831cd5f 100644 --- a/slope-evaluator/README.md +++ b/slope-evaluator/README.md @@ -24,3 +24,36 @@ Run the Docker image: You can set the `HOST` and the `PORT` (and a lot of more parameters) via environment variables. Default is `0.0.0.0:80`. For more information see [here](https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#advanced-usage). + +## API Documentation + +The running webserver provides a REST API with the following route: + +* /evaluate-slope + * Method: POST + * Body: + * total_lag + * threshold + * warmup + +The body of the request must be a JSON string that satisfies the following conditions: + +* **total_lag**: This property is based on the [Range Vector type](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-vectors) from Prometheus and must have the following JSON structure: + ``` + { + "metric": { + "group": "<label_value>" + }, + "values": [ + [ + <unix_timestamp>, + "<sample_value>" + ] + ] + } + ``` + * The `<label_value>` provided in "metric.group" must be equal to the id of the Kafka consumer group. + * The `<unix_timestamp>` provided as the first element of each element in the "values" array must be the timestamp of the measurement value in seconds (with optional decimal precision) + * The `<sample_value>` must be the measurement value as string. +* **threshold**: Must be an unsigned integer that specifies the threshold for the SLO evaluation. The SLO is considered fulfilled, if the result value is below the threshold. If the result value is equal or above the threshold, the SLO is considered not fulfilled. +* **warmup**: Specifieds the warmup time in seconds that are ignored for evaluating the SLO. \ No newline at end of file -- GitLab