flagger icon indicating copy to clipboard operation
flagger copied to clipboard

feat: implement a Keptn metrics provider

Open bacherfl opened this issue 2 years ago • 1 comments

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

bacherfl avatar Apr 16 '24 06:04 bacherfl

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 :)

bacherfl avatar Apr 30 '24 13:04 bacherfl

@aryan9600 could you please push your suggestions on top of this PR. I see that @bacherfl has enabled us to push commit.

stefanprodan avatar May 31 '24 13:05 stefanprodan

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

bacherfl avatar Jun 05 '24 05:06 bacherfl

PR updated, the docs could still use a bit more info around Anlysis/AnlysisDefinition, but we can tackle that in another PR @bacherfl

aryan9600 avatar Jun 10 '24 14:06 aryan9600

@aryan9600 please sync the CRDs, the helm chart has the old one.

stefanprodan avatar Jun 11 '24 06:06 stefanprodan

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.

aryan9600 avatar Jun 11 '24 14:06 aryan9600