Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

Gidi233
Copy link
Contributor

@Gidi233 Gidi233 commented Aug 26, 2024

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/"
    ......

Signed-off-by: Gidi233 <qpbtyfh@gmail.com>
Signed-off-by: Gidi233 <qpbtyfh@gmail.com>
Signed-off-by: Gidi233 <qpbtyfh@gmail.com>
Copy link

netlify bot commented Aug 26, 2024

Deploy Preview for kurator-dev ready!

Name Link
🔨 Latest commit dd45e9e
🔍 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.

Copy link
Contributor

@LiZhenCheng9527 LiZhenCheng9527 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost lgtm

@@ -1616,7 +1616,8 @@ <h3 id="apps.kurator.dev/v1alpha1.Metric">Metric
</td>
<td>
<p>Name of the metric.
Currently supported metric are <code>request-success-rate</code> and <code>request-duration</code>.</p>
Currently supported metric are <code>request-success-rate</code> and <code>request-duration</code>.
When Name is not <code>request-success-rate</code> or <code>request-duration</code>, you need to define the metric rule in CustomMetric.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if request-success-tare and request-duration are not available, you can use the metrics that come with the gateway without customising them.
Both scenarios should be made clear

Signed-off-by: Gidi233 <qpbtyfh@gmail.com>
@LiZhenCheng9527
Copy link
Contributor

/lgtm

Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kurator-bot
Copy link
Collaborator

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

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kurator-bot kurator-bot merged commit 86ca4ef into kurator-dev:main Aug 28, 2024
14 checks passed
@Gidi233 Gidi233 deleted the MetricTemplate branch August 28, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add customizable Metrics Analysis to the rollout API
4 participants