@@ -342,38 +342,45 @@ func (h *Head) resetInMemoryState() error {
342342}
343343
344344type headMetrics struct {
345- activeAppenders prometheus.Gauge
346- series prometheus.GaugeFunc
347- seriesCreated prometheus.Counter
348- seriesRemoved prometheus.Counter
349- seriesNotFound prometheus.Counter
350- chunks prometheus.Gauge
351- chunksCreated prometheus.Counter
352- chunksRemoved prometheus.Counter
353- gcDuration prometheus.Summary
354- samplesAppended * prometheus.CounterVec
355- outOfOrderSamplesAppended * prometheus.CounterVec
356- outOfBoundSamples * prometheus.CounterVec
357- outOfOrderSamples * prometheus.CounterVec
358- tooOldSamples * prometheus.CounterVec
359- walTruncateDuration prometheus.Summary
360- walCorruptionsTotal prometheus.Counter
361- dataTotalReplayDuration prometheus.Gauge
362- headTruncateFail prometheus.Counter
363- headTruncateTotal prometheus.Counter
364- checkpointDeleteFail prometheus.Counter
365- checkpointDeleteTotal prometheus.Counter
366- checkpointCreationFail prometheus.Counter
367- checkpointCreationTotal prometheus.Counter
368- mmapChunkCorruptionTotal prometheus.Counter
369- snapshotReplayErrorTotal prometheus.Counter // Will be either 0 or 1.
370- oooHistogram prometheus.Histogram
371- mmapChunksTotal prometheus.Counter
345+ activeAppenders prometheus.Gauge
346+ series prometheus.GaugeFunc
347+ seriesCreated prometheus.Counter
348+ seriesRemoved prometheus.Counter
349+ seriesNotFound prometheus.Counter
350+ chunks prometheus.Gauge
351+ chunksCreated prometheus.Counter
352+ chunksRemoved prometheus.Counter
353+ gcDuration prometheus.Summary
354+ successulSamplesAppended * prometheus.CounterVec
355+ // samplesAppended *prometheus.CounterVec
356+ // outOfOrderSamplesAppended *prometheus.CounterVec
357+ // outOfBoundSamples *prometheus.CounterVec
358+ // outOfOrderSamples *prometheus.CounterVec
359+ // tooOldSamples *prometheus.CounterVec
360+ walTruncateDuration prometheus.Summary
361+ walCorruptionsTotal prometheus.Counter
362+ dataTotalReplayDuration prometheus.Gauge
363+ headTruncateFail prometheus.Counter
364+ headTruncateTotal prometheus.Counter
365+ checkpointDeleteFail prometheus.Counter
366+ checkpointDeleteTotal prometheus.Counter
367+ checkpointCreationFail prometheus.Counter
368+ checkpointCreationTotal prometheus.Counter
369+ mmapChunkCorruptionTotal prometheus.Counter
370+ snapshotReplayErrorTotal prometheus.Counter // Will be either 0 or 1.
371+ oooHistogram prometheus.Histogram
372+ mmapChunksTotal prometheus.Counter
373+ sampleAppendFailures * prometheus.CounterVec
372374}
373375
374376const (
375377 sampleMetricTypeFloat = "float"
376378 sampleMetricTypeHistogram = "histogram"
379+ outOfBounds = "out_of_bounds"
380+ outOfOrder = "out_of_order"
381+ tooOld = "too_old"
382+ successfulAppends = "successful_appends"
383+ oooAppends = "ooo_appends"
377384)
378385
379386func newHeadMetrics (h * Head , r prometheus.Registerer ) * headMetrics {
@@ -428,26 +435,34 @@ func newHeadMetrics(h *Head, r prometheus.Registerer) *headMetrics {
428435 Name : "prometheus_tsdb_data_replay_duration_seconds" ,
429436 Help : "Time taken to replay the data on disk." ,
430437 }),
431- samplesAppended : prometheus .NewCounterVec (prometheus.CounterOpts {
432- Name : "prometheus_tsdb_head_samples_appended_total" ,
433- Help : "Total number of appended samples." ,
434- }, []string {"type" }),
435- outOfOrderSamplesAppended : prometheus .NewCounterVec (prometheus.CounterOpts {
436- Name : "prometheus_tsdb_head_out_of_order_samples_appended_total" ,
437- Help : "Total number of appended out of order samples." ,
438- }, []string {"type" }),
439- outOfBoundSamples : prometheus .NewCounterVec (prometheus.CounterOpts {
440- Name : "prometheus_tsdb_out_of_bound_samples_total" ,
441- Help : "Total number of out of bound samples ingestion failed attempts with out of order support disabled." ,
442- }, []string {"type" }),
443- outOfOrderSamples : prometheus .NewCounterVec (prometheus.CounterOpts {
444- Name : "prometheus_tsdb_out_of_order_samples_total" ,
445- Help : "Total number of out of order samples ingestion failed attempts due to out of order being disabled." ,
446- }, []string {"type" }),
447- tooOldSamples : prometheus .NewCounterVec (prometheus.CounterOpts {
448- Name : "prometheus_tsdb_too_old_samples_total" ,
449- Help : "Total number of out of order samples ingestion failed attempts with out of support enabled, but sample outside of time window." ,
450- }, []string {"type" }),
438+ successulSamplesAppended : prometheus .NewCounterVec (prometheus.CounterOpts {
439+ Name : "prometheus_tsdb_head_sucessful_samples_appended_total" ,
440+ Help : "Total number of successful appended samples including out of order samples." ,
441+ }, []string {"reason" , "type" }),
442+ sampleAppendFailures : prometheus .NewCounterVec (prometheus.CounterOpts {
443+ Name : "prometheus_tsdb_head_samples_append_failures_total" ,
444+ Help : "Total number of sample append failures with different reasons." ,
445+ }, []string {"reason" , "type" }),
446+ // samplesAppended: prometheus.NewCounterVec(prometheus.CounterOpts{
447+ // Name: "prometheus_tsdb_head_samples_appended_total",
448+ // Help: "Total number of appended samples.",
449+ // }, []string{"type"}),
450+ // outOfOrderSamplesAppended: prometheus.NewCounterVec(prometheus.CounterOpts{
451+ // Name: "prometheus_tsdb_head_out_of_order_samples_appended_total",
452+ // Help: "Total number of appended out of order samples.",
453+ // }, []string{"type"}),
454+ // outOfBoundSamples: prometheus.NewCounterVec(prometheus.CounterOpts{
455+ // Name: "prometheus_tsdb_out_of_bound_samples_total",
456+ // Help: "Total number of out of bound samples ingestion failed attempts with out of order support disabled.",
457+ // }, []string{"type"}),
458+ // outOfOrderSamples: prometheus.NewCounterVec(prometheus.CounterOpts{
459+ // Name: "prometheus_tsdb_out_of_order_samples_total",
460+ // Help: "Total number of out of order samples ingestion failed attempts due to out of order being disabled.",
461+ // }, []string{"type"}),
462+ // tooOldSamples: prometheus.NewCounterVec(prometheus.CounterOpts{
463+ // Name: "prometheus_tsdb_too_old_samples_total",
464+ // Help: "Total number of out of order samples ingestion failed attempts with out of support enabled, but sample outside of time window.",
465+ // }, []string{"type"}),
451466 headTruncateFail : prometheus .NewCounter (prometheus.CounterOpts {
452467 Name : "prometheus_tsdb_head_truncations_failed_total" ,
453468 Help : "Total number of head truncations that failed." ,
@@ -516,11 +531,13 @@ func newHeadMetrics(h *Head, r prometheus.Registerer) *headMetrics {
516531 m .walTruncateDuration ,
517532 m .walCorruptionsTotal ,
518533 m .dataTotalReplayDuration ,
519- m .samplesAppended ,
520- m .outOfOrderSamplesAppended ,
521- m .outOfBoundSamples ,
522- m .outOfOrderSamples ,
523- m .tooOldSamples ,
534+ // m.samplesAppended,
535+ m .successulSamplesAppended ,
536+ // m.outOfOrderSamplesAppended,
537+ m .sampleAppendFailures ,
538+ // m.outOfBoundSamples,
539+ // m.outOfOrderSamples,
540+ // m.tooOldSamples,
524541 m .headTruncateFail ,
525542 m .headTruncateTotal ,
526543 m .checkpointDeleteFail ,
0 commit comments