Files
weave-scope/probe/instrumentation.go
2015-05-19 10:05:03 +00:00

37 lines
760 B
Go

package main
import (
"net/http"
"time"
"github.com/prometheus/client_golang/prometheus"
)
var (
publishTicks = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "scope",
Subsystem: "probe",
Name: "publish_ticks",
Help: "Number of publish ticks observed.",
},
[]string{},
)
spyDuration = prometheus.NewSummaryVec(
prometheus.SummaryOpts{
Namespace: "scope",
Subsystem: "probe",
Name: "spy_time_nanoseconds",
Help: "Total time spent spying on active connections.",
MaxAge: 10 * time.Second, // like statsd
},
[]string{},
)
)
func makePrometheusHandler() http.Handler {
prometheus.MustRegister(publishTicks)
prometheus.MustRegister(spyDuration)
return prometheus.Handler()
}