Browse Source

Resurrect and rename invalid preload requests count metric.

It is now also used in label matching, so the name of the metric
changed from `prometheus_local_storage_invalid_preload_requests_total`
to `non_existent_series_matches_total'.
pull/1477/head
beorn7 9 years ago
parent
commit
199f309a39
  1. 34
      storage/local/storage.go

34
storage/local/storage.go

@ -159,15 +159,15 @@ type memorySeriesStorage struct {
quarantineRequests chan quarantineRequest quarantineRequests chan quarantineRequest
quarantineStopping, quarantineStopped chan struct{} quarantineStopping, quarantineStopped chan struct{}
persistErrors prometheus.Counter persistErrors prometheus.Counter
numSeries prometheus.Gauge numSeries prometheus.Gauge
seriesOps *prometheus.CounterVec seriesOps *prometheus.CounterVec
ingestedSamplesCount prometheus.Counter ingestedSamplesCount prometheus.Counter
outOfOrderSamplesCount prometheus.Counter outOfOrderSamplesCount prometheus.Counter
invalidPreloadRequestsCount prometheus.Counter nonExistentSeriesMatchesCount prometheus.Counter
maintainSeriesDuration *prometheus.SummaryVec maintainSeriesDuration *prometheus.SummaryVec
persistenceUrgencyScore prometheus.Gauge persistenceUrgencyScore prometheus.Gauge
rushedMode prometheus.Gauge rushedMode prometheus.Gauge
} }
// MemorySeriesStorageOptions contains options needed by // MemorySeriesStorageOptions contains options needed by
@ -248,11 +248,11 @@ func NewMemorySeriesStorage(o *MemorySeriesStorageOptions) Storage {
Name: "out_of_order_samples_total", Name: "out_of_order_samples_total",
Help: "The total number of samples that were discarded because their timestamps were at or before the last received sample for a series.", Help: "The total number of samples that were discarded because their timestamps were at or before the last received sample for a series.",
}), }),
invalidPreloadRequestsCount: prometheus.NewCounter(prometheus.CounterOpts{ nonExistentSeriesMatchesCount: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: namespace, Namespace: namespace,
Subsystem: subsystem, Subsystem: subsystem,
Name: "invalid_preload_requests_total", Name: "non_existent_series_matches_total",
Help: "The total number of preload requests referring to a non-existent series. This is an indication of outdated label indexes.", Help: "How often a non-existent series was referred to during label matching or chunk preloading. This is an indication of outdated label indexes.",
}), }),
maintainSeriesDuration: prometheus.NewSummaryVec( maintainSeriesDuration: prometheus.NewSummaryVec(
prometheus.SummaryOpts{ prometheus.SummaryOpts{
@ -545,7 +545,11 @@ func (s *memorySeriesStorage) metricForRange(
// The range lookup is relatively cheap, so let's do it first if // The range lookup is relatively cheap, so let's do it first if
// we have a chance the archived metric is not in the range. // we have a chance the archived metric is not in the range.
has, first, last := s.persistence.hasArchivedMetric(fp) has, first, last := s.persistence.hasArchivedMetric(fp)
if !has || first.After(through) || last.Before(from) { if !has {
s.nonExistentSeriesMatchesCount.Inc()
return nil, nil, false
}
if first.After(through) || last.Before(from) {
return nil, nil, false return nil, nil, false
} }
} }
@ -1492,7 +1496,7 @@ func (s *memorySeriesStorage) Describe(ch chan<- *prometheus.Desc) {
s.seriesOps.Describe(ch) s.seriesOps.Describe(ch)
ch <- s.ingestedSamplesCount.Desc() ch <- s.ingestedSamplesCount.Desc()
ch <- s.outOfOrderSamplesCount.Desc() ch <- s.outOfOrderSamplesCount.Desc()
ch <- s.invalidPreloadRequestsCount.Desc() ch <- s.nonExistentSeriesMatchesCount.Desc()
ch <- numMemChunksDesc ch <- numMemChunksDesc
s.maintainSeriesDuration.Describe(ch) s.maintainSeriesDuration.Describe(ch)
ch <- s.persistenceUrgencyScore.Desc() ch <- s.persistenceUrgencyScore.Desc()
@ -1519,7 +1523,7 @@ func (s *memorySeriesStorage) Collect(ch chan<- prometheus.Metric) {
s.seriesOps.Collect(ch) s.seriesOps.Collect(ch)
ch <- s.ingestedSamplesCount ch <- s.ingestedSamplesCount
ch <- s.outOfOrderSamplesCount ch <- s.outOfOrderSamplesCount
ch <- s.invalidPreloadRequestsCount ch <- s.nonExistentSeriesMatchesCount
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
numMemChunksDesc, numMemChunksDesc,
prometheus.GaugeValue, prometheus.GaugeValue,

Loading…
Cancel
Save