feat: implement a Keptn metrics provider
Closes #1627
This PR adds the implementation of a keptn metrics provider
The main difference to other providers in Flagger is that this one is using a Kubernetes client to interact with Keptn resources (KeptnMetrics and Analyses). Therefore, in addition to the code in keptn.go, the ClusterRole needed to be adapted to be able to access the required Keptn resources.
The provider supports the use of the following resources:
-
KeptnMetric: This resource represents the current value of a certain metric. The metric is retrieved by Keptn from one of the following data sources:prometheus,thanos,cortex,dynatrace,datadog. -
Analysis: This Keptn resource can be used to apply a more complex grading logic over a set of different metrics. More information about this concept can be found in the Keptn Docs
thanks @bacherfl for this! i did a quick first pass, will take a second look soon.
Thanks for the review @aryan9600! I just addressed your comments and adapted the code accordingly - If there are some further questions feel free to reach out :)
@aryan9600 could you please push your suggestions on top of this PR. I see that @bacherfl has enabled us to push commit.
Hi @stefanprodan @aryan9600 sorry for the late reply - I had a busy schedule recently. I'm not sure if i can get to incorporate the suggested changes this week, but I may have some time to do so next week - otherwise, feel free to add directly to the PR, as @stefanprodan suggested
PR updated, the docs could still use a bit more info around Anlysis/AnlysisDefinition, but we can tackle that in another PR @bacherfl
@aryan9600 please sync the CRDs, the helm chart has the old one.
kuma e2e test failure is unrelated, happening because the tarball has moved to another location. i think we should not let it block this PR. we can fix and bump the kuma version later.