From d14d6bebf7d49d60e788956463ce21bf29eb8637 Mon Sep 17 00:00:00 2001 From: Jason Collins <47123298+jcollins-axway@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:19:51 -0700 Subject: [PATCH] APIGOV-25897-update status text code ranges (#664) * update status text code ranges * APIGOV-25897 - cleanup from review --- pkg/transaction/metric/metricscollector.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/transaction/metric/metricscollector.go b/pkg/transaction/metric/metricscollector.go index 34ae73c31..2728d27c4 100644 --- a/pkg/transaction/metric/metricscollector.go +++ b/pkg/transaction/metric/metricscollector.go @@ -777,16 +777,14 @@ func (c *collector) cleanupMetricCounter(histogram metrics.Histogram, v4Data V4D func (c *collector) getStatusText(statusCode string) string { httpStatusCode, _ := strconv.Atoi(statusCode) - statusText := "Unknown" switch { - case httpStatusCode >= 200 && httpStatusCode < 400: - statusText = "Success" + case httpStatusCode >= 100 && httpStatusCode < 400: + return "Success" case httpStatusCode >= 400 && httpStatusCode < 500: - statusText = "Failure" - case httpStatusCode >= 500 && httpStatusCode < 511: - statusText = "Exception" + return "Failure" + default: + return "Exception" } - return statusText } func (c *collector) getConsumerOrgID(ri *v1.ResourceInstance) string {