fluxcd / flagger

Progressive delivery Kubernetes operator (Canary, A/B Testing and Blue/Green deployments)
https://docs.flagger.app
Apache License 2.0
4.87k stars 727 forks source link

Count metrics for canary releases #856

Open knechtionscoding opened 3 years ago

knechtionscoding commented 3 years ago

Currently the metrics exposed are gauges https://docs.flagger.app/usage/monitoring#metrics This is useful for individual canaries, but doesn't really allow tracking for cumulative actions, successes, failures, etc.

Being able to track how many canaries succeeded, how many canaries failed, and total canary releases.

stefanprodan commented 3 years ago

We could add a histogram to track the duration of each analysis run, a histogram exports a count so it covers your tracking needs.

knechtionscoding commented 3 years ago

Sure! I was going to push up a PR with three counters, attempts, failed, successful. But if histogram would cover it, I'm happy to go in that direction. I might need a little bit of advice on how to setup the histogram

knechtionscoding commented 3 years ago

I think there already is a duration histogram, right? https://github.com/fluxcd/flagger/blob/main/pkg/metrics/recorder.go#L44-L49 How do I translate that into a success/failure percentage?

knechtionscoding commented 3 years ago

@stefanprodan Happy to push something up here, if I can get a little more guidance, so that I don't duplicate work.