logmower-shipper/pkg/file/metrics.go

34 lines
1.2 KiB
Go
Raw Normal View History

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"
)
2022-11-09 19:13:36 +00:00
const promSubsystem = "file"
2022-11-09 16:07:28 +00:00
var (
promFileInitialSeekSkipped = promauto.NewGaugeVec(prometheus.GaugeOpts{
2022-11-09 19:13:36 +00:00
Namespace: globals.PrometheusPrefix, // Subsystem: promSubsystem,
Name: "skipped_bytes",
Help: "Bytes skipped in file after discovering",
2022-11-09 16:07:28 +00:00
}, []string{"filename"})
promFileCatchupDone = promauto.NewGaugeVec(prometheus.GaugeOpts{
2022-11-09 19:13:36 +00:00
Namespace: globals.PrometheusPrefix, Subsystem: promSubsystem,
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{
2022-11-09 19:13:36 +00:00
Namespace: globals.PrometheusPrefix, Subsystem: promSubsystem,
Name: "errors_count",
Help: "Errors while reading file",
2022-11-09 16:07:28 +00:00
}, []string{"filename"})
promFileLineSize = promauto.NewHistogramVec(prometheus.HistogramOpts{
2022-11-09 19:13:36 +00:00
Namespace: globals.PrometheusPrefix, Subsystem: promSubsystem,
2022-11-09 16:07:28 +00:00
Name: "line_size_bytes",
Help: "Log line size in bytes",
Buckets: []float64{80, 160, 320, 640, 1280},
}, []string{"filename"})
)