From 02324c168ccd8bd93966275925cacf6ae9bcaffb Mon Sep 17 00:00:00 2001 From: Leandro Mendes Date: Tue, 19 Nov 2024 18:06:12 +0100 Subject: [PATCH] fix: metrics fields in wrong order this commit fixes the order which the metrics parameters are sent, causing wrong data being sent. Signed-off-by: Leandro Mendes --- api/v1alpha1/release_types.go | 4 ++-- metrics/release.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/v1alpha1/release_types.go b/api/v1alpha1/release_types.go index ec84313f..ed60c2e2 100644 --- a/api/v1alpha1/release_types.go +++ b/api/v1alpha1/release_types.go @@ -455,11 +455,11 @@ func (r *Release) MarkReleased() { go metrics.RegisterCompletedRelease( r.Status.StartTime, r.Status.CompletionTime, + r.getPhaseReason(tenantProcessedConditionType), r.getPhaseReason(managedProcessedConditionType), + r.getPhaseReason(finalProcessedConditionType), SucceededReason.String(), r.Status.Target, - r.getPhaseReason(tenantProcessedConditionType), - r.getPhaseReason(finalProcessedConditionType), r.getPhaseReason(validatedConditionType), ) } diff --git a/metrics/release.go b/metrics/release.go index 99467443..a90c3dfb 100644 --- a/metrics/release.go +++ b/metrics/release.go @@ -132,11 +132,11 @@ func RegisterCompletedRelease(startTime, completionTime *metav1.Time, // Prometheus fails if these are not in alphabetical order labels := prometheus.Labels{ - "final_pipeline_processing_reason": finalProcessingReason, + "tenant_pipeline_processing_reason": tenantProcessingReason, "managed_pipeline_processing_reason": managedProcessingReason, + "final_pipeline_processing_reason": finalProcessingReason, "release_reason": releaseReason, "target": target, - "tenant_pipeline_processing_reason": tenantProcessingReason, "validation_reason": validationReason, } ReleaseConcurrentTotal.WithLabelValues().Dec()