prometheus

package
v2.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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

View Source
var HandlerFailuresCounter = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Namespace: namespace,
		Subsystem: handlerSubsystem,
		Name:      "failures_total",
		Help:      "Event handler failures, partitioned by route",
	},
	[]string{RouteLabel},
)

HandlerFailuresCounter - Prometheus counter for handler failures

Functions

func PublishHandlerMetrics

func PublishHandlerMetrics(next ziggurat.Handler) ziggurat.Handler

PublishHandlerMetrics - middleware to update registered handler metrics

func Register

func Register()

Register - Registers the Prometheus metrics

func StartMonitoringServer

func StartMonitoringServer(ctx context.Context, opts ...ServerOpts) error

StartMonitoringServer - starts a monitoring server for prometheus

Types

type ServerOpts

type ServerOpts func(*http.Server)

func WithAddr

func WithAddr(addr string) ServerOpts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL