Documentation
¶
Overview ¶
Package metrics provides Prometheus HTTP instrumentation for Gin.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler() gin.HandlerFunc
Handler returns a Gin handler that serves Prometheus metrics in the text exposition format.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics holds Prometheus collectors for HTTP instrumentation.
func New ¶
func New() *Metrics
New creates a Metrics instance and registers collectors with the default Prometheus registry.
func (*Metrics) Middleware ¶
func (m *Metrics) Middleware() gin.HandlerFunc
Middleware returns a Gin middleware that records request count, duration, and response size for every HTTP request.
Click to show internal directories.
Click to hide internal directories.