mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove unused metric (#90327)
This commit is contained in:
parent
3bb861b9f0
commit
d0afa60feb
@ -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
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user