When given a non-usable `--prometheus-url`, We start the
rollout without verifying if the prometheus is reachable or not. This
is a problem as we will be unable to get the metrics from prometheus
and hence the rollout will be reverted later causing unnecessary
time waste.
This can be prevented by performing a simple check to see if the
prometheus is reachable or not. `up` query is used instead of
key metrics as we can't be sure of their existence.
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
This PR updates the Version field in root to
be set correctly and also use the same with
the cobra CLI.
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
DecisionRevert means to revert
DecisionNoData means that there is no data to make an informed decision
DecisionMoveForward means to move forward based on data
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
\# `No Data` Variant
This commit adds a new variant that the `Analysis.MoveForward`
function can return. This variant is used to indicate that there
isn't enough data to make a concrete decision about the rollout.
This is then coupled with the `Rollout.OkayScoreUntilNoData` to
move rollout forward until a specific point even when there is
no data so that data can actually be created. If no data
is present even after `OkayScoreUntilNoData` is reached, then
we rollback as we aren't making an informed rollout. If positive,
we move forward. If negative, we rollback.
\# Target Based Metric Analysis
In this commit, We add a new `ErrorRatioAnalyzer` through which we
calculate the success target percentage by doing
((totalRequests - errorRequests)/totalRequests) * 100 and compare it
with the target percentage provided by the user. This means users can
specify a target percentage (i.e 99%, etc) at which a new cluster
can be considered safe. We rollback, If it is less than that.
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
This also includes:
- make actions using RolloutAction Interface
- abstract out the analysis logic into a separate package
- bugfix: don't close the channel
- working prototype with metric analysis
- logs refactor
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>