mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Added telemetry for counting stored samples
Change-Id: I0f36f7c2738d070ca2f107fcb315f98e46803af3
This commit is contained in:
parent
3bf3a555b2
commit
28f59edf16
|
@ -72,6 +72,7 @@ var (
|
|||
storageOperationDurations = prometheus.NewCounter()
|
||||
storageLatency = prometheus.NewHistogram(diskLatencyHistogram)
|
||||
queueSizes = prometheus.NewGauge()
|
||||
storedSamplesCount = prometheus.NewCounter()
|
||||
)
|
||||
|
||||
func recordOutcome(duration time.Duration, err error, success, failure map[string]string) {
|
||||
|
@ -94,4 +95,5 @@ func init() {
|
|||
prometheus.Register("curation_filter_operations_total", "The number of curation filter operations completed.", prometheus.NilLabels, curationFilterOperations)
|
||||
prometheus.Register("curation_duration_ms_total", "The total time spent in curation (ms).", prometheus.NilLabels, curationDuration)
|
||||
prometheus.Register("curation_durations_ms", "Histogram of time spent in curation (ms).", prometheus.NilLabels, curationDurations)
|
||||
prometheus.Register("prometheus_stored_samples_total", "The number of samples that have been stored.", prometheus.NilLabels, storedSamplesCount)
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
clientmodel "github.com/prometheus/client_golang/model"
|
||||
|
||||
|
@ -168,6 +169,7 @@ func (t *TieredStorage) AppendSamples(samples clientmodel.Samples) (err error) {
|
|||
}
|
||||
|
||||
t.memoryArena.AppendSamples(samples)
|
||||
storedSamplesCount.IncrementBy(prometheus.NilLabels, float64(len(samples)))
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue