mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 10:41:14 +00:00
37 lines
760 B
Go
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()
|
|
}
|