refactor prometheus metrics
This commit is contained in:
parent
a56e6d1ffc
commit
b03c845406
@ -14,21 +14,21 @@ import (
|
|||||||
func mongoMonitoredClientOptions(l *zap.Logger) *mongoOpt.ClientOptions {
|
func mongoMonitoredClientOptions(l *zap.Logger) *mongoOpt.ClientOptions {
|
||||||
promMongoHeartbeat := promauto.NewHistogramVec(prom.HistogramOpts{
|
promMongoHeartbeat := promauto.NewHistogramVec(prom.HistogramOpts{
|
||||||
Subsystem: "mongo",
|
Subsystem: "mongo",
|
||||||
Name: "heartbeat",
|
Name: "heartbeat_time",
|
||||||
Help: "Time in ns for succeeded heartbeat, or 0 on failure",
|
Help: "Time in ns for succeeded heartbeat, or 0 on failure",
|
||||||
Buckets: []float64{1},
|
Buckets: []float64{1},
|
||||||
}, []string{"connection_id"})
|
}, []string{"connection_id"})
|
||||||
|
|
||||||
promMongoCmd := promauto.NewHistogramVec(prom.HistogramOpts{
|
promMongoCmd := promauto.NewHistogramVec(prom.HistogramOpts{
|
||||||
Subsystem: "mongo",
|
Subsystem: "mongo",
|
||||||
Name: "command",
|
Name: "command_time",
|
||||||
Help: "Time in ns of commands",
|
Help: "Time in ns of commands",
|
||||||
Buckets: prom.DefBuckets,
|
Buckets: prom.DefBuckets,
|
||||||
}, []string{"connection_id", "command_name"})
|
}, []string{"connection_id", "command_name"})
|
||||||
|
|
||||||
promMongoCmdErr := promauto.NewCounterVec(prom.CounterOpts{
|
promMongoCmdErr := promauto.NewCounterVec(prom.CounterOpts{
|
||||||
Subsystem: "mongo",
|
Subsystem: "mongo",
|
||||||
Name: "errors_count",
|
Name: "errors",
|
||||||
Help: "Count of failed commands",
|
Help: "Count of failed commands",
|
||||||
}, []string{"connection_id", "command_name"})
|
}, []string{"connection_id", "command_name"})
|
||||||
|
|
||||||
|
@ -85,12 +85,12 @@ var App = &cli.App{
|
|||||||
|
|
||||||
promErrWatching = promauto.NewCounter(prom.CounterOpts{
|
promErrWatching = promauto.NewCounter(prom.CounterOpts{
|
||||||
Subsystem: "watcher",
|
Subsystem: "watcher",
|
||||||
Name: "errors_count",
|
Name: "errors",
|
||||||
Help: "Error in logmower watching log files",
|
Help: "Error in logmower watching log files",
|
||||||
})
|
})
|
||||||
promFilesRead = promauto.NewCounter(prom.CounterOpts{
|
promFilesRead = promauto.NewCounter(prom.CounterOpts{
|
||||||
Subsystem: "watcher",
|
Subsystem: "watcher",
|
||||||
Name: "file_count",
|
Name: "seen_files",
|
||||||
Help: "Number of tracked log files",
|
Help: "Number of tracked log files",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -15,27 +15,27 @@ import (
|
|||||||
var (
|
var (
|
||||||
promShipperMongoSent = promauto.NewCounterVec(prom.CounterOpts{
|
promShipperMongoSent = promauto.NewCounterVec(prom.CounterOpts{
|
||||||
Subsystem: "shipper",
|
Subsystem: "shipper",
|
||||||
Name: "sent_count",
|
Name: "sent",
|
||||||
Help: "Items successfully committed to mongo",
|
Help: "Items successfully committed to mongo",
|
||||||
}, []string{"filename"})
|
}, []string{"filename"})
|
||||||
promShipperMongoSentError = promauto.NewCounterVec(prom.CounterOpts{
|
promShipperMongoSentError = promauto.NewCounterVec(prom.CounterOpts{
|
||||||
Subsystem: "shipper",
|
Subsystem: "shipper",
|
||||||
Name: "mongo_errors_count",
|
Name: "mongo_errors",
|
||||||
Help: "Errors while submitting to mongo", // TODO:
|
Help: "Errors while submitting to mongo", // TODO:
|
||||||
}, []string{"filename"})
|
}, []string{"filename"})
|
||||||
promShipperDropped = promauto.NewCounterVec(prom.CounterOpts{
|
promShipperDropped = promauto.NewCounterVec(prom.CounterOpts{
|
||||||
Subsystem: "shipper",
|
Subsystem: "shipper",
|
||||||
Name: "queue_dropped_count",
|
Name: "queue_dropped",
|
||||||
Help: "Items ready to be batched and sent to mongo, but dropped due to full queue",
|
Help: "Items ready to be batched and sent to mongo, but dropped due to full queue",
|
||||||
}, []string{"filename"})
|
}, []string{"filename"})
|
||||||
promLineParsingErr = promauto.NewCounterVec(prom.CounterOpts{
|
promLineParsingErr = promauto.NewCounterVec(prom.CounterOpts{
|
||||||
Subsystem: "shipper",
|
Subsystem: "shipper",
|
||||||
Name: "lines_parsing_err_count",
|
Name: "lines_parsing_errors",
|
||||||
Help: "Errors while parsing log line suffixes",
|
Help: "Errors while parsing log line suffixes",
|
||||||
}, []string{"filename"})
|
}, []string{"filename"})
|
||||||
promShipperQueueItems = promauto.NewHistogramVec(prom.HistogramOpts{
|
promShipperQueueItems = promauto.NewHistogramVec(prom.HistogramOpts{
|
||||||
Subsystem: "shipper",
|
Subsystem: "shipper",
|
||||||
Name: "queue_items",
|
Name: "queued",
|
||||||
Help: "Items in queue to be batched and sent to mongo",
|
Help: "Items in queue to be batched and sent to mongo",
|
||||||
}, []string{"filename"})
|
}, []string{"filename"})
|
||||||
promShipperSynced = promauto.NewGaugeVec(prom.GaugeOpts{
|
promShipperSynced = promauto.NewGaugeVec(prom.GaugeOpts{
|
||||||
|
Loading…
Reference in New Issue
Block a user