2022-11-09 16:07:28 +00:00
|
|
|
package file
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.k-space.ee/k-space/logmower-shipper/pkg/globals"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
promFileInitialSeekSkipped = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
|
|
Namespace: globals.PrometheusPrefix,
|
|
|
|
// Subsystem: "file",
|
|
|
|
Name: "skipped_bytes",
|
|
|
|
Help: "Bytes skipped in file after discovering",
|
|
|
|
}, []string{"filename"})
|
|
|
|
promFileCatchupDone = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
|
|
Namespace: globals.PrometheusPrefix,
|
|
|
|
Subsystem: "file",
|
|
|
|
Name: "catchupped",
|
|
|
|
Help: "(0 or) 1 if initial backlog has been sent; (total <= watcher_file_count)",
|
2022-11-09 17:52:02 +00:00
|
|
|
}, []string{"filename"})
|
2022-11-09 16:07:28 +00:00
|
|
|
promFileErr = promauto.NewCounterVec(prometheus.CounterOpts{
|
|
|
|
Namespace: globals.PrometheusPrefix,
|
|
|
|
Subsystem: "file",
|
|
|
|
Name: "errors_count",
|
|
|
|
Help: "Errors while reading file",
|
|
|
|
}, []string{"filename"})
|
|
|
|
promFileLineSize = promauto.NewHistogramVec(prometheus.HistogramOpts{
|
|
|
|
Namespace: globals.PrometheusPrefix,
|
|
|
|
// Subsystem: "file",
|
|
|
|
Name: "line_size_bytes",
|
|
|
|
Help: "Log line size in bytes",
|
|
|
|
Buckets: []float64{80, 160, 320, 640, 1280},
|
|
|
|
}, []string{"filename"})
|
|
|
|
)
|