You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2020/11/10 10:20:16 UTC
[camel-k] 16/25: chore: Rename build recovery attempts metric
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit e40b5f11bb26cf734f9186dcdcc708477a93e9dc
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Oct 21 17:54:41 2020 +0200
chore: Rename build recovery attempts metric
---
pkg/controller/build/metrics.go | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/pkg/controller/build/metrics.go b/pkg/controller/build/metrics.go
index 2b9950b..20b052f 100644
--- a/pkg/controller/build/metrics.go
+++ b/pkg/controller/build/metrics.go
@@ -31,17 +31,6 @@ import (
const buildResultLabel = "result"
var (
- buildAttempts = prometheus.NewHistogramVec(
- prometheus.HistogramOpts{
- Name: "camel_k_build_attempts",
- Help: "Camel K build attempts",
- Buckets: []float64{1, 2, 3, 4, 5},
- },
- []string{
- buildResultLabel,
- },
- )
-
buildDuration = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: "camel_k_build_duration_seconds",
@@ -60,6 +49,17 @@ var (
},
)
+ buildRecovery = prometheus.NewHistogramVec(
+ prometheus.HistogramOpts{
+ Name: "camel_k_build_recovery_attempts",
+ Help: "Camel K build recovery attempts",
+ Buckets: []float64{0, 1, 2, 3, 4, 5},
+ },
+ []string{
+ buildResultLabel,
+ },
+ )
+
queueDuration = prometheus.NewHistogram(
prometheus.HistogramOpts{
Name: "camel_k_build_queue_duration_seconds",
@@ -77,7 +77,7 @@ var (
func init() {
// Register custom metrics with the global prometheus registry
- metrics.Registry.MustRegister(buildAttempts, buildDuration, queueDuration)
+ metrics.Registry.MustRegister(buildDuration, buildRecovery, queueDuration)
}
func observeBuildResult(build *v1.Build, phase v1.BuildPhase, duration time.Duration) {
@@ -89,7 +89,7 @@ func observeBuildResult(build *v1.Build, phase v1.BuildPhase, duration time.Dura
phase = v1.BuildPhaseError
}
- buildAttempts.WithLabelValues(phase.String()).Observe(float64(attempt))
+ buildRecovery.WithLabelValues(phase.String()).Observe(float64(attempt))
buildDuration.WithLabelValues(phase.String()).Observe(duration.Seconds())
}