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

Add canary analysis result as Prometheus metrics #1148

Merged

Conversation

cdlliuy
Copy link
Contributor

@cdlliuy cdlliuy commented Mar 17, 2022

Fix of #1147

With this code changes, in my demo case, I can get the following metrics:

# HELP flagger_canary_duration_seconds Seconds spent performing canary analysis.
# HELP flagger_canary_metric_analysis Last canary metric analysis result per different metric template
# TYPE flagger_canary_metric_analysis gauge
flagger_canary_metric_analysis{metricTemplate="flagger-helloworld-demo-error-message-analysis-existing-error-ratio",name="flagger-helloworld-demo-deployment",namespace="ying-cd-poc"} 0.918223108974359
flagger_canary_metric_analysis{metricTemplate="flagger-helloworld-demo-error-message-analysis-new-error",name="flagger-helloworld-demo-deployment",namespace="ying-cd-poc"} 1
flagger_canary_metric_analysis{metricTemplate="flagger-helloworld-demo-http-successful-rate",name="flagger-helloworld-demo-deployment",namespace="ying-cd-poc"} 100

Let me know if there are any testcase are required.

Ying Liu and others added 2 commits March 25, 2022 23:10
@cdlliuy cdlliuy force-pushed the add_canary_analysis_result_as_metric branch from c34cd92 to 1348332 Compare March 25, 2022 15:10
@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2022

Codecov Report

Merging #1148 (e0186cb) into main (307813a) will decrease coverage by 0.50%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1148      +/-   ##
==========================================
- Coverage   57.29%   56.78%   -0.51%     
==========================================
  Files          78       79       +1     
  Lines        6343     6611     +268     
==========================================
+ Hits         3634     3754     +120     
- Misses       2166     2301     +135     
- Partials      543      556      +13     
Impacted Files Coverage Δ
pkg/controller/scheduler_metrics.go 37.11% <100.00%> (+1.32%) ⬆️
pkg/canary/deployment_controller.go 62.75% <0.00%> (-1.64%) ⬇️
pkg/canary/status.go 48.36% <0.00%> (-0.65%) ⬇️
pkg/controller/scheduler_hooks.go 8.10% <0.00%> (-0.35%) ⬇️
pkg/router/factory.go 0.00% <0.00%> (ø)
pkg/router/gateway_api.go 43.53% <0.00%> (ø)
pkg/router/appmesh_v1beta2.go 88.37% <0.00%> (+0.25%) ⬆️
pkg/router/appmesh.go 85.80% <0.00%> (+0.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 307813a...e0186cb. Read the comment docs.

@cdlliuy
Copy link
Contributor Author

cdlliuy commented Mar 28, 2022

@stefanprodan , updated the PR for the suggested changes. Can you help to review again? Thanks!

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

@cdlliuy
Copy link
Contributor Author

cdlliuy commented Apr 6, 2022

@stefanprodan , updated the PR for the suggested changes. Can you help to review again? Thanks!

@stefanprodan stefanprodan changed the title add canary analysis result as prometheus metrics Add canary analysis result as Prometheus metrics Apr 6, 2022
@stefanprodan stefanprodan added the kind/enhancement Improvement request for an existing feature label Apr 6, 2022
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @cdlliuy 🏅

@stefanprodan stefanprodan merged commit 793b93c into fluxcd:main Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvement request for an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants