diff --git a/modules/pubmatic/openwrap/metrics/config/metrics.go b/modules/pubmatic/openwrap/metrics/config/metrics.go index e5f31ee72dd..cf67a7e652a 100644 --- a/modules/pubmatic/openwrap/metrics/config/metrics.go +++ b/modules/pubmatic/openwrap/metrics/config/metrics.go @@ -445,10 +445,3 @@ func (me *MultiMetricsEngine) RecordOWServerPanic(endpoint, methodName, nodeName thisME.RecordOWServerPanic(endpoint, methodName, nodeName, podName) } } - -// RecordCountry records count of requests received with req.device.geo.country -func (me *MultiMetricsEngine) RecordCountry(pubID string) { - for _, thisME := range *me { - thisME.RecordCountry(pubID) - } -} diff --git a/modules/pubmatic/openwrap/metrics/config/metrics_test.go b/modules/pubmatic/openwrap/metrics/config/metrics_test.go index 2523657934a..6f80fed117e 100644 --- a/modules/pubmatic/openwrap/metrics/config/metrics_test.go +++ b/modules/pubmatic/openwrap/metrics/config/metrics_test.go @@ -217,7 +217,6 @@ func TestRecordFunctionForMultiMetricsEngine(t *testing.T) { mockEngine.EXPECT().RecordSendLoggerDataTime("requestType", "profileid", time.Second) mockEngine.EXPECT().RecordRequestTime("requestType", time.Second) mockEngine.EXPECT().RecordOWServerPanic("endpoint", "methodName", "nodeName", "podName") - mockEngine.EXPECT().RecordCountry("pubID") // create the multi-metric engine multiMetricEngine := MultiMetricsEngine{} @@ -280,5 +279,4 @@ func TestRecordFunctionForMultiMetricsEngine(t *testing.T) { multiMetricEngine.RecordSendLoggerDataTime("requestType", "profileid", time.Second) multiMetricEngine.RecordRequestTime("requestType", time.Second) multiMetricEngine.RecordOWServerPanic("endpoint", "methodName", "nodeName", "podName") - multiMetricEngine.RecordCountry("pubID") } diff --git a/modules/pubmatic/openwrap/metrics/metrics.go b/modules/pubmatic/openwrap/metrics/metrics.go index 7848f993bc0..3d00bf73219 100644 --- a/modules/pubmatic/openwrap/metrics/metrics.go +++ b/modules/pubmatic/openwrap/metrics/metrics.go @@ -72,5 +72,4 @@ type MetricsEngine interface { RecordSendLoggerDataTime(requestType, profileid string, sendTime time.Duration) RecordRequestTime(requestType string, requestTime time.Duration) RecordOWServerPanic(endpoint, methodName, nodeName, podName string) - RecordCountry(pubID string) } diff --git a/modules/pubmatic/openwrap/metrics/mock/mock.go b/modules/pubmatic/openwrap/metrics/mock/mock.go index 392ed5ca864..03dc3b0ae19 100644 --- a/modules/pubmatic/openwrap/metrics/mock/mock.go +++ b/modules/pubmatic/openwrap/metrics/mock/mock.go @@ -323,18 +323,6 @@ func (mr *MockMetricsEngineMockRecorder) RecordOWServerPanic(arg0, arg1, arg2, a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecordOWServerPanic", reflect.TypeOf((*MockMetricsEngine)(nil).RecordOWServerPanic), arg0, arg1, arg2, arg3) } -// RecordCountry mocks base method. -func (m *MockMetricsEngine) RecordCountry(arg0 string) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RecordCountry", arg0) -} - -// RecordBids indicates an expected call of RecordCountry. -func (mr *MockMetricsEngineMockRecorder) RecordCountry(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecordCountry", reflect.TypeOf((*MockMetricsEngine)(nil).RecordCountry), arg0) -} - // RecordOpenWrapServerPanicStats mocks base method. func (m *MockMetricsEngine) RecordOpenWrapServerPanicStats(arg0, arg1 string) { m.ctrl.T.Helper() diff --git a/modules/pubmatic/openwrap/metrics/prometheus/prometheus.go b/modules/pubmatic/openwrap/metrics/prometheus/prometheus.go index b5d5bd2e631..94e439773bf 100644 --- a/modules/pubmatic/openwrap/metrics/prometheus/prometheus.go +++ b/modules/pubmatic/openwrap/metrics/prometheus/prometheus.go @@ -65,7 +65,6 @@ type Metrics struct { panicCounts *prometheus.CounterVec sendLoggerData *prometheus.HistogramVec owRequestTime *prometheus.HistogramVec - country *prometheus.CounterVec } const ( diff --git a/modules/pubmatic/openwrap/metrics/prometheus/prometheus_sshb.go b/modules/pubmatic/openwrap/metrics/prometheus/prometheus_sshb.go index f47e27b0333..bad86d6ce13 100644 --- a/modules/pubmatic/openwrap/metrics/prometheus/prometheus_sshb.go +++ b/modules/pubmatic/openwrap/metrics/prometheus/prometheus_sshb.go @@ -107,11 +107,6 @@ func newSSHBMetrics(metrics *Metrics, cfg *config.PrometheusMetrics, promRegistr "Counts the header-bidding server panic.", []string{nodeNameLabel, podNameLabel, methodNameLabel, endpointLabel}) - metrics.country = newCounter(cfg, promRegistry, - "sshb_country", - "Count of requests received with publishers Country by publisher id.", - []string{pubIDLabel}) - preloadLabelValues(metrics) } @@ -199,13 +194,6 @@ func (m *Metrics) RecordOWServerPanic(endpoint, methodName, nodeName, podName st }).Inc() } -// RecordCountry records count of requests received with req.device.geo.country -func (m *Metrics) RecordCountry(pubID string) { - m.country.With(prometheus.Labels{ - pubIDLabel: pubID, - }).Inc() -} - func preloadLabelValues(m *Metrics) { var ( requestStatusValues = requestStatusesAsString() diff --git a/modules/pubmatic/openwrap/metrics/prometheus/prometheus_sshb_test.go b/modules/pubmatic/openwrap/metrics/prometheus/prometheus_sshb_test.go index 7a6a7842017..fc3423529ff 100644 --- a/modules/pubmatic/openwrap/metrics/prometheus/prometheus_sshb_test.go +++ b/modules/pubmatic/openwrap/metrics/prometheus/prometheus_sshb_test.go @@ -387,31 +387,3 @@ func TestRegisterLabelPermutations(t *testing.T) { assert.ElementsMatch(t, test.expectedLabels, resultLabels) } } - -func TestMetricsRecordCountry(t *testing.T) { - m := createMetricsForTesting() - type args struct { - pubID string - } - tests := []struct { - name string - args args - want float64 - }{ - { - name: "call_record_country", - args: args{ - pubID: "1010", - }, - want: 1, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - m.RecordCountry(tt.args.pubID) - assertCounterVecValue(t, "", "country", m.country, tt.want, prometheus.Labels{ - pubIDLabel: tt.args.pubID, - }) - }) - } -} diff --git a/modules/pubmatic/openwrap/metrics/stats/tcp_stats.go b/modules/pubmatic/openwrap/metrics/stats/tcp_stats.go index bb3b23d2c8c..86a1936e6f5 100644 --- a/modules/pubmatic/openwrap/metrics/stats/tcp_stats.go +++ b/modules/pubmatic/openwrap/metrics/stats/tcp_stats.go @@ -339,4 +339,3 @@ func (st *StatsTCP) RecordCtvUaAccuracy(pubId, status string) func (st *StatsTCP) RecordSendLoggerDataTime(requestType, profileid string, sendTime time.Duration) {} func (st *StatsTCP) RecordRequestTime(requestType string, requestTime time.Duration) {} func (st *StatsTCP) RecordOWServerPanic(endpoint, methodName, nodeName, podName string) {} -func (st *StatsTCP) RecordCountry(pubID string) {}