Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Logger ¶
func Logger() echo.MiddlewareFunc
func LoggerWithConfig ¶
func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc
Types ¶
type LoggerConfig ¶
type LoggerConfig struct {
Skipper middleware.Skipper
// BlackListEndpoint is the list of endpoint that you don't want to log with the info level.
// An endpoint is matched when the route registered in echo (like /metrics, /debug/pprof/* or /api/v1/projects/:project) contains one of these values.
// The route is used instead of the URL, as the URL is controlled by the client, who must not be able to change the log level of its requests.
BlackListEndpoint []string
}
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics provides a way to monitor an API with a middleware to use
func NewMetrics ¶
func (*Metrics) Collect ¶
func (m *Metrics) Collect(ch chan<- prometheus.Metric)
func (*Metrics) Describe ¶
func (m *Metrics) Describe(ch chan<- *prometheus.Desc)
func (*Metrics) ProcessHTTPRequest ¶
func (m *Metrics) ProcessHTTPRequest(next echo.HandlerFunc) echo.HandlerFunc
ProcessHTTPRequest is an echo middleware. It will intercept all responses. It will increase the metrics that count the number of HTTP request and calculate the time took to respond.
Click to show internal directories.
Click to hide internal directories.