kurator-dev / kurator

Unified resource orchestration, unified scheduling, unified traffic management and unified telemetry for distributed cloud
https://kurator.dev
Apache License 2.0
242 stars 39 forks source link

Feat: Add customizable Metrics Analysis to the rollout API #683

Closed Gidi233 closed 2 months ago

Gidi233 commented 2 months ago

What type of PR is this?

/kind api-change /kind feature

What this PR does / why we need it: Providing users with customizable Metrics Analysis enables users to flexibly adjust according to different needs and scenarios, ensuring that users can obtain more accurate analysis results that meet specific business applications, thereby improving the operability of the system and the accuracy of data analysis.

Which issue(s) this PR fixes: Fixes #681

Does this PR introduce a user-facing change?:

    ......
          trafficAnalysis:
             checkIntervalSeconds: 90
             checkFailedTimes: 2
             metrics:
             - name: request-success-rate
               intervalSeconds: 90
               thresholdRange:
                 min: 99
             - name: my-metric
               intervalSeconds: 90
               thresholdRange:
                 max: 99
               customMetric: 
                 provider: 
                   type: prometheus
                   address: http://flagger-prometheus.ingress-nginx:9090
                 query: |
                   sum(
                     rate(
                       http_requests_total{
                         status!~"5.*"
                       }[{{ interval }}]
                     )
                   )
                   /
                   sum(
                     rate(
                       http_requests_total[{{ interval }}]
                     )
                   ) * 100
             webhooks:
                 timeoutSeconds: 60
                 command:
                 - "hey -z 1m -q 10 -c 2 http://backend-canary.webapp:9898/"
    ......
netlify[bot] commented 2 months ago

Deploy Preview for kurator-dev ready!

Name Link
Latest commit dd45e9e47fdc6043a4e26c3180a7943cf4c8522e
Latest deploy log https://app.netlify.com/sites/kurator-dev/deploys/66cd91329acee6000823b90d
Deploy Preview https://deploy-preview-683--kurator-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

LiZhenCheng9527 commented 2 months ago

/lgtm

kurator-bot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kurator-dev/kurator/blob/main/OWNERS)~~ [hzxuzhonghu] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment