Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TotalRequests = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "http_requests_total", Help: "Total number of HTTP requests.", }, []string{"path"}, ) ResponseDuration = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Name: "http_response_duration_seconds", Help: "Histogram of response durations.", Buckets: prometheus.DefBuckets, }, []string{"path"}, ) LastRequestTime = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "http_last_request_time_seconds", Help: "Timestamp of the last HTTP request received.", }, []string{"path"}, ) StatusCodeCounts = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "http_status_code_counts", Help: "Counts of HTTP status codes.", }, []string{"path", "status"}, ) )
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware() gin.HandlerFunc
func LoggerMiddleware ¶
func LoggerMiddleware() gin.HandlerFunc
The`LoggerMiddleware` function -------------------------------------------------------- returns a Gin `Handler Function` that measures the request time, and Logs basic information about the request
func PrometheusMiddleware ¶
func PrometheusMiddleware() gin.HandlerFunc
func RegisterMiddlewares ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.