forked from TrueCloudLab/frostfs-s3-gw
38 lines
659 B
Go
38 lines
659 B
Go
package metrics
|
|
|
|
import "github.com/prometheus/client_golang/prometheus"
|
|
|
|
const (
|
|
droppedLogs = "dropped_logs"
|
|
)
|
|
|
|
type logsMetric struct {
|
|
droppedLogs prometheus.Counter
|
|
}
|
|
|
|
func newLogsMetrics() *logsMetric {
|
|
return &logsMetric{
|
|
droppedLogs: mustNewCounter(appMetricsDesc[statisticSubsystem][droppedLogs]),
|
|
}
|
|
}
|
|
|
|
func (m *logsMetric) DroppedLogsInc() {
|
|
if m == nil {
|
|
return
|
|
}
|
|
m.droppedLogs.Inc()
|
|
}
|
|
|
|
func (m *logsMetric) Describe(descs chan<- *prometheus.Desc) {
|
|
if m == nil {
|
|
return
|
|
}
|
|
m.droppedLogs.Describe(descs)
|
|
}
|
|
|
|
func (m *logsMetric) Collect(metrics chan<- prometheus.Metric) {
|
|
if m == nil {
|
|
return
|
|
}
|
|
m.droppedLogs.Collect(metrics)
|
|
}
|