From 4f04b8b11e8b1dbc12aa187a5f53e8ed3b69b3f1 Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Wed, 12 Jun 2024 03:39:50 +0530 Subject: [PATCH] Deprecated metrics deletion (#16086) Signed-off-by: Manan Gupta --- changelog/21.0/21.0.0/summary.md | 36 +++++++ changelog/21.0/README.md | 2 + changelog/README.md | 1 + go/stats/counter.go | 33 ------- go/stats/counter_test.go | 95 ------------------- go/stats/counters.go | 16 ---- go/stats/counters_test.go | 49 ---------- go/stats/timings.go | 16 ---- go/stats/timings_test.go | 49 ---------- go/test/endtoend/vtorc/api/api_test.go | 12 --- .../primaryfailure/primary_failure_test.go | 6 -- go/test/endtoend/vtorc/utils/utils.go | 8 +- .../reparentutil/emergency_reparenter.go | 2 +- .../vtctl/reparentutil/planned_reparenter.go | 2 +- go/vt/vtctl/reparentutil/util.go | 2 +- go/vt/vtorc/inst/analysis_dao.go | 3 +- go/vt/vtorc/inst/audit_dao.go | 3 +- go/vt/vtorc/inst/instance_dao.go | 5 +- go/vt/vtorc/logic/vtorc.go | 11 +-- 19 files changed, 55 insertions(+), 296 deletions(-) create mode 100644 changelog/21.0/21.0.0/summary.md create mode 100644 changelog/21.0/README.md diff --git a/changelog/21.0/21.0.0/summary.md b/changelog/21.0/21.0.0/summary.md new file mode 100644 index 00000000000..1d894120cae --- /dev/null +++ b/changelog/21.0/21.0.0/summary.md @@ -0,0 +1,36 @@ + +## Summary + +### Table of Contents + +- **[Major Changes](#major-changes)** + - **[Deletions](#deletions)** + - [Deletion of deprecated metrics](#metric-deletion) + - **[Breaking changes](#breaking-changes)** + +## Major Changes + +### Deletion + +#### Deletion of deprecated metrics + +The following metrics that were deprecated in the previous release, have now been deleted. + + +| Metric Name | +|:--------------------------------------------:| +| `analysis.change.write` | +| `audit.write` | +| `discoveries.attempt` | +| `discoveries.fail` | +| `discoveries.instance_poll_seconds_exceeded` | +| `discoveries.queue_length` | +| `discoveries.recent_count` | +| `instance.read` | +| `instance.read_topology` | +| `emergency_reparent_counts` | +| `planned_reparent_counts` | +| `reparent_shard_operation_timings` | + + + diff --git a/changelog/21.0/README.md b/changelog/21.0/README.md new file mode 100644 index 00000000000..bade1b597f8 --- /dev/null +++ b/changelog/21.0/README.md @@ -0,0 +1,2 @@ +## v21.0 +* **[21.0.0](21.0.0)** diff --git a/changelog/README.md b/changelog/README.md index 3a55d986643..9feda6440c6 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -1,4 +1,5 @@ ## Releases +* [21.0](21.0) * [20.0](20.0) * [19.0](19.0) * [18.0](18.0) diff --git a/go/stats/counter.go b/go/stats/counter.go index e74969039f6..4428dfe1136 100644 --- a/go/stats/counter.go +++ b/go/stats/counter.go @@ -17,8 +17,6 @@ limitations under the License. package stats import ( - "expvar" - "fmt" "math" "strconv" "sync/atomic" @@ -47,22 +45,6 @@ func NewCounter(name string, help string) *Counter { return v } -// NewCounterWithDeprecatedName returns a new Counter that also has a deprecated name that can be removed in a future release. -// It is important to ensure that we only call this function with values for name and deprecatedName such that they match to the same -// metric name in snake case. -func NewCounterWithDeprecatedName(name string, deprecatedName string, help string) *Counter { - // Ensure that the snake case for the deprecated name and the new name are the same. - if deprecatedName == "" || GetSnakeName(name) != GetSnakeName(deprecatedName) { - panic(fmt.Sprintf("New name for deprecated metric doesn't have the same snake case - %v", deprecatedName)) - } - - v := NewCounter(deprecatedName, help) - // We have already published the deprecated name for backward compatibility. - // At the same time we want the new metric to be visible on the `/debug/vars` page, so we publish the new name in expvar. - expvar.Publish(name, v) - return v -} - // Add adds the provided value to the Counter. func (v *Counter) Add(delta int64) { if delta < 0 { @@ -154,21 +136,6 @@ func NewGauge(name string, help string) *Gauge { return v } -// NewGaugeWithDeprecatedName creates a new Gauge and publishes it if name is set that also has a deprecated name that can be removed in a future release. -// It is important to ensure that we only call this function with values for name and deprecatedName such that they match to the same metric name in snake case. -func NewGaugeWithDeprecatedName(name string, deprecatedName string, help string) *Gauge { - // Ensure that the snake case for the deprecated name and the new name are the same. - if deprecatedName == "" || GetSnakeName(name) != GetSnakeName(deprecatedName) { - panic(fmt.Sprintf("New name for deprecated metric doesn't have the same snake case - %v", deprecatedName)) - } - - v := NewGauge(deprecatedName, help) - // We have already published the deprecated name for backward compatibility. - // At the same time we want the new metric to be visible on the `/debug/vars` page, so we publish the new name in expvar. - expvar.Publish(name, v) - return v -} - // Set overwrites the current value. func (v *Gauge) Set(value int64) { v.Counter.i.Store(value) diff --git a/go/stats/counter_test.go b/go/stats/counter_test.go index 6a7b496dfab..f290dc733d7 100644 --- a/go/stats/counter_test.go +++ b/go/stats/counter_test.go @@ -18,12 +18,9 @@ package stats import ( "expvar" - "fmt" - "sync" "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestCounter(t *testing.T) { @@ -94,95 +91,3 @@ func TestGaugeFloat64(t *testing.T) { v.Reset() assert.Equal(t, float64(0), v.Get()) } - -func TestNewCounterWithDeprecatedName(t *testing.T) { - clearStats() - Register(func(name string, v expvar.Var) {}) - - testcases := []struct { - name string - deprecatedName string - shouldPanic bool - }{ - { - name: "new_name", - deprecatedName: "deprecatedName", - shouldPanic: true, - }, - { - name: "metricName_test", - deprecatedName: "metric.name-test", - shouldPanic: false, - }, - { - name: "MetricNameTesting", - deprecatedName: "metric.name.testing", - shouldPanic: false, - }, - } - - for _, testcase := range testcases { - t.Run(fmt.Sprintf("%v-%v", testcase.name, testcase.deprecatedName), func(t *testing.T) { - wg := sync.WaitGroup{} - wg.Add(1) - panicReceived := false - go func() { - defer func() { - if x := recover(); x != nil { - panicReceived = true - } - wg.Done() - }() - NewCounterWithDeprecatedName(testcase.name, testcase.deprecatedName, "help") - }() - wg.Wait() - require.EqualValues(t, testcase.shouldPanic, panicReceived) - }) - } -} - -func TestNewGaugeWithDeprecatedName(t *testing.T) { - clearStats() - Register(func(name string, v expvar.Var) {}) - - testcases := []struct { - name string - deprecatedName string - shouldPanic bool - }{ - { - name: "gauge_new_name", - deprecatedName: "gauge_deprecatedName", - shouldPanic: true, - }, - { - name: "gauge-metricName_test", - deprecatedName: "gauge_metric.name-test", - shouldPanic: false, - }, - { - name: "GaugeMetricNameTesting", - deprecatedName: "gauge.metric.name.testing", - shouldPanic: false, - }, - } - - for _, testcase := range testcases { - t.Run(fmt.Sprintf("%v-%v", testcase.name, testcase.deprecatedName), func(t *testing.T) { - wg := sync.WaitGroup{} - wg.Add(1) - panicReceived := false - go func() { - defer func() { - if x := recover(); x != nil { - panicReceived = true - } - wg.Done() - }() - NewGaugeWithDeprecatedName(testcase.name, testcase.deprecatedName, "help") - }() - wg.Wait() - require.EqualValues(t, testcase.shouldPanic, panicReceived) - }) - } -} diff --git a/go/stats/counters.go b/go/stats/counters.go index b3099993b09..bcf7fc3a8b6 100644 --- a/go/stats/counters.go +++ b/go/stats/counters.go @@ -18,7 +18,6 @@ package stats import ( "bytes" - "expvar" "fmt" "strings" "sync" @@ -186,21 +185,6 @@ func NewCountersWithMultiLabels(name, help string, labels []string) *CountersWit return t } -// NewCountersWithMultiLabelsWithDeprecatedName returns a new CountersWithMultiLabels that also has a deprecated name that can be removed in a future release. -// It is important to ensure that we only call this function with values for name and deprecatedName such that they match to the same -// metric name in snake case. -func NewCountersWithMultiLabelsWithDeprecatedName(name string, deprecatedName string, help string, labels []string) *CountersWithMultiLabels { - // Ensure that the snake case for the deprecated name and the new name are the same. - if deprecatedName == "" || GetSnakeName(name) != GetSnakeName(deprecatedName) { - panic(fmt.Sprintf("New name for deprecated metric doesn't have the same snake case - %v", deprecatedName)) - } - t := NewCountersWithMultiLabels(deprecatedName, help, labels) - // We have already published the deprecated name for backward compatibility. - // At the same time we want the new metric to be visible on the `/debug/vars` page, so we publish the new name in expvar. - expvar.Publish(name, t) - return t -} - // Labels returns the list of labels. func (mc *CountersWithMultiLabels) Labels() []string { return mc.labels diff --git a/go/stats/counters_test.go b/go/stats/counters_test.go index e1b171a2765..72eb11e1a10 100644 --- a/go/stats/counters_test.go +++ b/go/stats/counters_test.go @@ -18,17 +18,14 @@ package stats import ( "expvar" - "fmt" "math/rand/v2" "reflect" "sort" "strings" - "sync" "testing" "time" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestCounters(t *testing.T) { @@ -272,49 +269,3 @@ func TestCountersCombineDimension(t *testing.T) { c4.Add([]string{"c4", "c2", "c5"}, 1) assert.Equal(t, `{"all.c2.all": 2}`, c4.String()) } - -func TestNewCountersWithMultiLabelsWithDeprecatedName(t *testing.T) { - clearStats() - Register(func(name string, v expvar.Var) {}) - - testcases := []struct { - name string - deprecatedName string - shouldPanic bool - }{ - { - name: "counterWithMultiLabels_new_name", - deprecatedName: "counterWithMultiLabels_deprecatedName", - shouldPanic: true, - }, - { - name: "counterWithMultiLabels-metricName_test", - deprecatedName: "counterWithMultiLabels_metric.name-test", - shouldPanic: false, - }, - { - name: "CounterWithMultiLabelsMetricNameTesting", - deprecatedName: "counterWithMultiLabels.metric.name.testing", - shouldPanic: false, - }, - } - - for _, testcase := range testcases { - t.Run(fmt.Sprintf("%v-%v", testcase.name, testcase.deprecatedName), func(t *testing.T) { - wg := sync.WaitGroup{} - wg.Add(1) - panicReceived := false - go func() { - defer func() { - if x := recover(); x != nil { - panicReceived = true - } - wg.Done() - }() - NewCountersWithMultiLabelsWithDeprecatedName(testcase.name, testcase.deprecatedName, "help", []string{"1", "2", "3"}) - }() - wg.Wait() - require.EqualValues(t, testcase.shouldPanic, panicReceived) - }) - } -} diff --git a/go/stats/timings.go b/go/stats/timings.go index 9742ad4d67c..d0fb82ebedf 100644 --- a/go/stats/timings.go +++ b/go/stats/timings.go @@ -18,7 +18,6 @@ package stats import ( "encoding/json" - "expvar" "fmt" "sync" "sync/atomic" @@ -62,21 +61,6 @@ func NewTimings(name, help, label string, categories ...string) *Timings { return t } -// NewTimingsWithDeprecatedName returns a new Timings that also has a deprecated name that can be removed in a future release. -// It is important to ensure that we only call this function with values for name and deprecatedName such that they match to the same -// metric name in snake case. -func NewTimingsWithDeprecatedName(name string, deprecatedName string, help, label string, categories ...string) *Timings { - // Ensure that the snake case for the deprecated name and the new name are the same. - if deprecatedName == "" || GetSnakeName(name) != GetSnakeName(deprecatedName) { - panic(fmt.Sprintf("New name for deprecated metric doesn't have the same snake case - %v", deprecatedName)) - } - t := NewTimings(deprecatedName, help, label, categories...) - // We have already published the deprecated name for backward compatibility. - // At the same time we want the new metric to be visible on the `/debug/vars` page, so we publish the new name in expvar. - expvar.Publish(name, t) - return t -} - // Reset will clear histograms and counters: used during testing func (t *Timings) Reset() { t.mu.RLock() diff --git a/go/stats/timings_test.go b/go/stats/timings_test.go index 518d38947e5..a632f3fba6a 100644 --- a/go/stats/timings_test.go +++ b/go/stats/timings_test.go @@ -18,14 +18,11 @@ package stats import ( "expvar" - "fmt" "strings" - "sync" "testing" "time" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestTimings(t *testing.T) { @@ -102,49 +99,3 @@ func TestTimingsCombineDimension(t *testing.T) { want = `{"TotalCount":1,"TotalTime":1,"Histograms":{"all.c2.all":{"500000":1,"1000000":0,"5000000":0,"10000000":0,"50000000":0,"100000000":0,"500000000":0,"1000000000":0,"5000000000":0,"10000000000":0,"inf":0,"Count":1,"Time":1}}}` assert.Equal(t, want, t3.String()) } - -func TestNewTimingsWithDeprecatedName(t *testing.T) { - clearStats() - Register(func(name string, v expvar.Var) {}) - - testcases := []struct { - name string - deprecatedName string - shouldPanic bool - }{ - { - name: "timings_new_name", - deprecatedName: "timings_deprecatedName", - shouldPanic: true, - }, - { - name: "timings-metricName_test", - deprecatedName: "timings_metric.name-test", - shouldPanic: false, - }, - { - name: "TimingsMetricNameTesting", - deprecatedName: "timings.metric.name.testing", - shouldPanic: false, - }, - } - - for _, testcase := range testcases { - t.Run(fmt.Sprintf("%v-%v", testcase.name, testcase.deprecatedName), func(t *testing.T) { - wg := sync.WaitGroup{} - wg.Add(1) - panicReceived := false - go func() { - defer func() { - if x := recover(); x != nil { - panicReceived = true - } - wg.Done() - }() - NewTimingsWithDeprecatedName(testcase.name, testcase.deprecatedName, "help", "label", []string{"1", "2", "3"}...) - }() - wg.Wait() - require.EqualValues(t, testcase.shouldPanic, panicReceived) - }) - } -} diff --git a/go/test/endtoend/vtorc/api/api_test.go b/go/test/endtoend/vtorc/api/api_test.go index 8fa24a39ac7..174ee5ea914 100644 --- a/go/test/endtoend/vtorc/api/api_test.go +++ b/go/test/endtoend/vtorc/api/api_test.go @@ -110,18 +110,6 @@ func TestAPIEndpoints(t *testing.T) { }) t.Run("Check Vars and Metrics", func(t *testing.T) { - // These are vars that will be deprecated in v21. - utils.CheckVarExists(t, vtorc, "analysis.change.write") - utils.CheckVarExists(t, vtorc, "audit.write") - utils.CheckVarExists(t, vtorc, "discoveries.attempt") - utils.CheckVarExists(t, vtorc, "discoveries.fail") - utils.CheckVarExists(t, vtorc, "discoveries.instance_poll_seconds_exceeded") - utils.CheckVarExists(t, vtorc, "discoveries.queue_length") - utils.CheckVarExists(t, vtorc, "discoveries.recent_count") - utils.CheckVarExists(t, vtorc, "instance.read") - utils.CheckVarExists(t, vtorc, "instance.read_topology") - - // Newly added vars. utils.CheckVarExists(t, vtorc, "AnalysisChangeWrite") utils.CheckVarExists(t, vtorc, "AuditWrite") utils.CheckVarExists(t, vtorc, "DiscoveriesAttempt") diff --git a/go/test/endtoend/vtorc/primaryfailure/primary_failure_test.go b/go/test/endtoend/vtorc/primaryfailure/primary_failure_test.go index 645b413799c..886aa3a580a 100644 --- a/go/test/endtoend/vtorc/primaryfailure/primary_failure_test.go +++ b/go/test/endtoend/vtorc/primaryfailure/primary_failure_test.go @@ -102,12 +102,6 @@ func TestDownPrimary(t *testing.T) { utils.WaitForSuccessfulRecoveryCount(t, vtOrcProcess, logic.RecoverDeadPrimaryRecoveryName, 1) utils.WaitForSuccessfulERSCount(t, vtOrcProcess, keyspace.Name, shard0.Name, 1) t.Run("Check ERS and PRS Vars and Metrics", func(t *testing.T) { - // These are vars that will be deprecated in v21. - utils.CheckVarExists(t, vtOrcProcess, "emergency_reparent_counts") - utils.CheckVarExists(t, vtOrcProcess, "planned_reparent_counts") - utils.CheckVarExists(t, vtOrcProcess, "reparent_shard_operation_timings") - - // Newly added vars utils.CheckVarExists(t, vtOrcProcess, "EmergencyReparentCounts") utils.CheckVarExists(t, vtOrcProcess, "PlannedReparentCounts") utils.CheckVarExists(t, vtOrcProcess, "ReparentShardOperationTimings") diff --git a/go/test/endtoend/vtorc/utils/utils.go b/go/test/endtoend/vtorc/utils/utils.go index 5982589af85..63500377f47 100644 --- a/go/test/endtoend/vtorc/utils/utils.go +++ b/go/test/endtoend/vtorc/utils/utils.go @@ -1018,7 +1018,7 @@ func WaitForSuccessfulPRSCount(t *testing.T, vtorcInstance *cluster.VTOrcProcess mapKey := fmt.Sprintf("%v.%v.success", keyspace, shard) for time.Since(startTime) < timeout { vars := vtorcInstance.GetVars() - prsCountsMap := vars["planned_reparent_counts"].(map[string]interface{}) + prsCountsMap := vars["PlannedReparentCounts"].(map[string]interface{}) successCount := getIntFromValue(prsCountsMap[mapKey]) if successCount == countExpected { return @@ -1026,7 +1026,7 @@ func WaitForSuccessfulPRSCount(t *testing.T, vtorcInstance *cluster.VTOrcProcess time.Sleep(time.Second) } vars := vtorcInstance.GetVars() - prsCountsMap := vars["planned_reparent_counts"].(map[string]interface{}) + prsCountsMap := vars["PlannedReparentCounts"].(map[string]interface{}) successCount := getIntFromValue(prsCountsMap[mapKey]) assert.EqualValues(t, countExpected, successCount) } @@ -1039,7 +1039,7 @@ func WaitForSuccessfulERSCount(t *testing.T, vtorcInstance *cluster.VTOrcProcess mapKey := fmt.Sprintf("%v.%v.success", keyspace, shard) for time.Since(startTime) < timeout { vars := vtorcInstance.GetVars() - ersCountsMap := vars["emergency_reparent_counts"].(map[string]interface{}) + ersCountsMap := vars["EmergencyReparentCounts"].(map[string]interface{}) successCount := getIntFromValue(ersCountsMap[mapKey]) if successCount == countExpected { return @@ -1047,7 +1047,7 @@ func WaitForSuccessfulERSCount(t *testing.T, vtorcInstance *cluster.VTOrcProcess time.Sleep(time.Second) } vars := vtorcInstance.GetVars() - ersCountsMap := vars["emergency_reparent_counts"].(map[string]interface{}) + ersCountsMap := vars["EmergencyReparentCounts"].(map[string]interface{}) successCount := getIntFromValue(ersCountsMap[mapKey]) assert.EqualValues(t, countExpected, successCount) } diff --git a/go/vt/vtctl/reparentutil/emergency_reparenter.go b/go/vt/vtctl/reparentutil/emergency_reparenter.go index d7e5b8a8445..60e423c502c 100644 --- a/go/vt/vtctl/reparentutil/emergency_reparenter.go +++ b/go/vt/vtctl/reparentutil/emergency_reparenter.go @@ -68,7 +68,7 @@ type EmergencyReparentOptions struct { } // counters for Emergency Reparent Shard -var ersCounter = stats.NewCountersWithMultiLabelsWithDeprecatedName("EmergencyReparentCounts", "emergency_reparent_counts", "Number of times Emergency Reparent Shard has been run", +var ersCounter = stats.NewCountersWithMultiLabels("EmergencyReparentCounts", "Number of times Emergency Reparent Shard has been run", []string{"Keyspace", "Shard", "Result"}, ) diff --git a/go/vt/vtctl/reparentutil/planned_reparenter.go b/go/vt/vtctl/reparentutil/planned_reparenter.go index 3ef327987e3..c311a5c836c 100644 --- a/go/vt/vtctl/reparentutil/planned_reparenter.go +++ b/go/vt/vtctl/reparentutil/planned_reparenter.go @@ -41,7 +41,7 @@ import ( // counters for Planned Reparent Shard var ( - prsCounter = stats.NewCountersWithMultiLabelsWithDeprecatedName("PlannedReparentCounts", "planned_reparent_counts", "Number of times Planned Reparent Shard has been run", + prsCounter = stats.NewCountersWithMultiLabels("PlannedReparentCounts", "Number of times Planned Reparent Shard has been run", []string{"Keyspace", "Shard", "Result"}, ) ) diff --git a/go/vt/vtctl/reparentutil/util.go b/go/vt/vtctl/reparentutil/util.go index 4ea4d25ed83..5962ff9fa24 100644 --- a/go/vt/vtctl/reparentutil/util.go +++ b/go/vt/vtctl/reparentutil/util.go @@ -44,7 +44,7 @@ import ( ) var ( - reparentShardOpTimings = stats.NewTimingsWithDeprecatedName("ReparentShardOperationTimings", "reparent_shard_operation_timings", "Timings of reparent shard operations", "Operation") + reparentShardOpTimings = stats.NewTimings("ReparentShardOperationTimings", "Timings of reparent shard operations", "Operation") failureResult = "failure" successResult = "success" ) diff --git a/go/vt/vtorc/inst/analysis_dao.go b/go/vt/vtorc/inst/analysis_dao.go index b9bf1fba236..0268a8b183a 100644 --- a/go/vt/vtorc/inst/analysis_dao.go +++ b/go/vt/vtorc/inst/analysis_dao.go @@ -36,8 +36,7 @@ import ( "vitess.io/vitess/go/vt/vtorc/util" ) -// The metric is registered with a deprecated name. The old metric name can be removed in v21. -var analysisChangeWriteCounter = stats.NewCounterWithDeprecatedName("AnalysisChangeWrite", "analysis.change.write", "Number of times analysis has changed") +var analysisChangeWriteCounter = stats.NewCounter("AnalysisChangeWrite", "Number of times analysis has changed") var recentInstantAnalysis *cache.Cache diff --git a/go/vt/vtorc/inst/audit_dao.go b/go/vt/vtorc/inst/audit_dao.go index eb6eb226b70..d048f300faf 100644 --- a/go/vt/vtorc/inst/audit_dao.go +++ b/go/vt/vtorc/inst/audit_dao.go @@ -27,8 +27,7 @@ import ( "vitess.io/vitess/go/vt/vtorc/db" ) -// The metric is registered with a deprecated name. The old metric name can be removed in v21. -var auditOperationCounter = stats.NewCounterWithDeprecatedName("AuditWrite", "audit.write", "Number of audit operations performed") +var auditOperationCounter = stats.NewCounter("AuditWrite", "Number of audit operations performed") // AuditOperation creates and writes a new audit entry by given params func AuditOperation(auditType string, tabletAlias string, message string) error { diff --git a/go/vt/vtorc/inst/instance_dao.go b/go/vt/vtorc/inst/instance_dao.go index dddfcf640fe..0615cbc0cde 100644 --- a/go/vt/vtorc/inst/instance_dao.go +++ b/go/vt/vtorc/inst/instance_dao.go @@ -59,9 +59,8 @@ var ( var forgetAliases *cache.Cache var ( - // The metrics are registered with deprecated names. The old metric names can be removed in v21. - readTopologyInstanceCounter = stats.NewCounterWithDeprecatedName("InstanceReadTopology", "instance.read_topology", "Number of times an instance was read from the topology") - readInstanceCounter = stats.NewCounterWithDeprecatedName("InstanceRead", "instance.read", "Number of times an instance was read") + readTopologyInstanceCounter = stats.NewCounter("InstanceReadTopology", "Number of times an instance was read from the topology") + readInstanceCounter = stats.NewCounter("InstanceRead", "Number of times an instance was read") backendWrites = collection.CreateOrReturnCollection("BACKEND_WRITES") writeBufferLatency = stopwatch.NewNamedStopwatch() ) diff --git a/go/vt/vtorc/logic/vtorc.go b/go/vt/vtorc/logic/vtorc.go index 0e38f6e3aae..9a468d1508a 100644 --- a/go/vt/vtorc/logic/vtorc.go +++ b/go/vt/vtorc/logic/vtorc.go @@ -50,12 +50,11 @@ var snapshotDiscoveryKeys chan string var snapshotDiscoveryKeysMutex sync.Mutex var hasReceivedSIGTERM int32 -// The metrics are registered with deprecated names. The old metric names can be removed in v21. -var discoveriesCounter = stats.NewCounterWithDeprecatedName("DiscoveriesAttempt", "discoveries.attempt", "Number of discoveries attempted") -var failedDiscoveriesCounter = stats.NewCounterWithDeprecatedName("DiscoveriesFail", "discoveries.fail", "Number of failed discoveries") -var instancePollSecondsExceededCounter = stats.NewCounterWithDeprecatedName("DiscoveriesInstancePollSecondsExceeded", "discoveries.instance_poll_seconds_exceeded", "Number of instances that took longer than InstancePollSeconds to poll") -var discoveryQueueLengthGauge = stats.NewGaugeWithDeprecatedName("DiscoveriesQueueLength", "discoveries.queue_length", "Length of the discovery queue") -var discoveryRecentCountGauge = stats.NewGaugeWithDeprecatedName("DiscoveriesRecentCount", "discoveries.recent_count", "Number of recent discoveries") +var discoveriesCounter = stats.NewCounter("DiscoveriesAttempt", "Number of discoveries attempted") +var failedDiscoveriesCounter = stats.NewCounter("DiscoveriesFail", "Number of failed discoveries") +var instancePollSecondsExceededCounter = stats.NewCounter("DiscoveriesInstancePollSecondsExceeded", "Number of instances that took longer than InstancePollSeconds to poll") +var discoveryQueueLengthGauge = stats.NewGauge("DiscoveriesQueueLength", "Length of the discovery queue") +var discoveryRecentCountGauge = stats.NewGauge("DiscoveriesRecentCount", "Number of recent discoveries") var discoveryMetrics = collection.CreateOrReturnCollection(DiscoveryMetricsName) var recentDiscoveryOperationKeys *cache.Cache