From ace6ece9a5c1b6a74b8b90e6334405cebeab0c3b Mon Sep 17 00:00:00 2001 From: Mohan Dutt Parashar Date: Fri, 30 Jun 2023 18:49:48 +0530 Subject: [PATCH] adding l6etenant label in addition to existing tenant label, this change is required for consistency --- go/httpmetrics/metrics.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/go/httpmetrics/metrics.go b/go/httpmetrics/metrics.go index 6c878e9..7e8816e 100644 --- a/go/httpmetrics/metrics.go +++ b/go/httpmetrics/metrics.go @@ -15,10 +15,11 @@ import ( ) const ( - labelDomain = "domain" - labelMethod = "method" - labelStatus = "status" - labelPer = "per" + labelDomain = "domain" + labelMethod = "method" + labelStatus = "status" + labelPer = "per" + labelL6etenant = "l6etenant" ) var ( @@ -26,6 +27,7 @@ var ( defaultLabels = []string{ labelPer, proc.LabelHostname, labelDomain, labelMethod, proc.LabelProgram, labelStatus, proc.LabelTenant, proc.LabelCluster, + labelL6etenant, } // the ONLY metric that we emit is httpRequestsDuration @@ -107,6 +109,7 @@ func CustomREDHandler(g LabelMaker, next http.Handler) http.Handler { proc.LabelCluster: "", // default cluster is empty labelDomain: r.Host, labelMethod: r.Method, + labelL6etenant: "", // default l6etenant is empty } ctx := context.WithValue(r.Context(), enableMiddleware, "true") @@ -142,6 +145,8 @@ func CustomREDHandler(g LabelMaker, next http.Handler) http.Handler { } } + labels[labelL6etenant] = labels[proc.LabelTenant] + httpRequestsDuration.With(labels).Observe( float64(time.Since(start).Milliseconds()), )