Skip to content

Add canary analysis result as Prometheus metrics#1148

Merged
stefanprodan merged 3 commits intofluxcd:mainfrom
cdlliuy:add_canary_analysis_result_as_metric
Apr 6, 2022
Merged

Add canary analysis result as Prometheus metrics#1148
stefanprodan merged 3 commits intofluxcd:mainfrom
cdlliuy:add_canary_analysis_result_as_metric

Conversation

@cdlliuy
Copy link
Copy Markdown

@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.

@cdlliuy cdlliuy requested a review from stefanprodan as a code owner March 17, 2022 08:53
Ying Liu and others added 2 commits March 25, 2022 23:10
Signed-off-by: Ying Liu <ying.liu.lying@gmail.com>
Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
Signed-off-by: Ying Liu <ying.liu.lying@gmail.com>
@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
Copy Markdown

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
Copy Markdown
Author

cdlliuy commented Mar 28, 2022

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

Copy link
Copy Markdown
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.

Signed-off-by: Ying Liu <ying.liu.lying@gmail.com>
@cdlliuy
Copy link
Copy Markdown
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
Copy Markdown
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