Remove unused metric (#90327)

This commit is contained in:
Leonor Oliveira 2024-07-11 14:31:37 +01:00 committed by GitHub
parent 3bb861b9f0
commit d0afa60feb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 16 deletions

View File

@ -106,7 +106,6 @@ func (d *DualWriterMode2) Get(ctx context.Context, name string, options *metav1.
// if there is no object in storage, we return the object from legacy
if objStorage == nil {
d.recordReadLegacyCount(options.Kind, method)
return objLegacy, nil
}
return objStorage, err
@ -185,7 +184,6 @@ func (d *DualWriterMode2) List(ctx context.Context, options *metainternalversion
return sl, nil
}
log.Info("lists from legacy and storage are not the same size")
d.recordReadLegacyCount(options.Kind, method)
return ll, nil
}

View File

@ -9,10 +9,9 @@ import (
)
type dualWriterMetrics struct {
legacy *prometheus.HistogramVec
storage *prometheus.HistogramVec
outcome *prometheus.HistogramVec
legacyReads *prometheus.CounterVec
legacy *prometheus.HistogramVec
storage *prometheus.HistogramVec
outcome *prometheus.HistogramVec
}
// DualWriterStorageDuration is a metric summary for dual writer storage duration per mode
@ -39,12 +38,6 @@ var DualWriterOutcome = prometheus.NewHistogramVec(prometheus.HistogramOpts{
NativeHistogramBucketFactor: 1.1,
}, []string{"mode", "name", "method"})
var DualWriterReadLegacyCounts = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "dual_writer_read_legacy_count",
Help: "Histogram for the runtime of dual writer reads from legacy",
Namespace: "grafana",
}, []string{"kind", "method"})
func (m *dualWriterMetrics) init(reg prometheus.Registerer) {
log := klog.NewKlogr()
m.legacy = DualWriterLegacyDuration
@ -75,7 +68,3 @@ func (m *dualWriterMetrics) recordOutcome(mode string, name string, areEqual boo
}
m.outcome.WithLabelValues(mode, name, method).Observe(observeValue)
}
func (m *dualWriterMetrics) recordReadLegacyCount(kind string, method string) {
m.legacyReads.WithLabelValues(kind, method).Inc()
}