MCPcopy
hub / github.com/prometheus/prometheus / Watcher

Struct Watcher

tsdb/wlog/watcher.go:90–119  ·  view source on GitHub ↗

Watcher watches the TSDB WAL for a given WriteTo.

Source from the content-addressed store, hash-verified

88
89// Watcher watches the TSDB WAL for a given WriteTo.
90type Watcher struct {
91 name string
92 writer WriteTo
93 recordBuf *record.BuffersPool
94 logger *slog.Logger
95 walDir string
96 lastCheckpoint string
97 sendExemplars bool
98 sendHistograms bool
99 sendMetadata bool
100 metrics *WatcherMetrics
101 readerMetrics *LiveReaderMetrics
102
103 startTime time.Time
104 startTimestamp int64 // the start time as a Prometheus timestamp
105 sendSamples bool
106
107 recordsReadMetric *prometheus.CounterVec
108 recordDecodeFailsMetric prometheus.Counter
109 samplesSentPreTailing prometheus.Counter
110 currentSegmentMetric prometheus.Gauge
111 notificationsSkipped prometheus.Counter
112
113 readNotify chan struct{}
114 quit chan struct{}
115 done chan struct{}
116
117 // For testing, stop when we hit this segment.
118 MaxSegment int
119}
120
121func NewWatcherMetrics(reg prometheus.Registerer) *WatcherMetrics {
122 m := &WatcherMetrics{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected