fleet/server/service/metrics.go
Victor Vrantchan 24b9baec1f add prometheus endpoint (#236)
generate metrics for Users, Appconfig and Session services
2016-09-28 07:35:15 -04:00

27 lines
573 B
Go

package service
import (
"github.com/go-kit/kit/metrics"
"github.com/kolide/kolide-ose/server/kolide"
)
type metricsMiddleware struct {
kolide.Service
requestCount metrics.Counter
requestLatency metrics.Histogram
}
// NewMetrics service takes an existing service and wraps it
// with instrumentation middleware.
func NewMetricsService(
svc kolide.Service,
requestCount metrics.Counter,
requestLatency metrics.Histogram,
) kolide.Service {
return metricsMiddleware{
Service: svc,
requestCount: requestCount,
requestLatency: requestLatency,
}
}