Documentation
¶
Index ¶
Constants ¶
View Source
const (
// RouteLabel - Key for route label
RouteLabel = "route"
)
Variables ¶
View Source
var HandlerDurationHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: namespace, Subsystem: handlerSubsystem, Name: "duration_seconds", Help: "time spent processing events, partitioned by route", }, []string{"route"}, )
HandlerDurationHistogram - Prometheus histogram for handler duration
View Source
var HandlerEventsCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: namespace, Subsystem: handlerSubsystem, Name: "events_total", Help: "Events passed on to the handler, partitioned by route", }, []string{RouteLabel}, )
HandlerEventsCounter - Prometheus counter for handled events
Functions ¶
func PublishHandlerMetrics ¶
func PublishHandlerMetrics(next ziggurat.Handler) ziggurat.Handler
PublishHandlerMetrics - middleware to update registered handler metrics
func StartMonitoringServer ¶
func StartMonitoringServer(ctx context.Context, opts ...ServerOpts) error
StartMonitoringServer - starts a monitoring server for prometheus
Types ¶
type ServerOpts ¶
func WithAddr ¶
func WithAddr(addr string) ServerOpts
Click to show internal directories.
Click to hide internal directories.