mirror of
https://github.com/kemko/reproxy.git
synced 2026-01-06 18:25:49 +03:00
implement basic support of metrics via mgmt server #35
This commit is contained in:
@@ -36,6 +36,7 @@ type Http struct { // nolint golint
|
||||
StdOutEnabled bool
|
||||
Signature bool
|
||||
Timeouts Timeouts
|
||||
Metrics Metrics
|
||||
}
|
||||
|
||||
// Matcher source info (server and route) to the destination url
|
||||
@@ -46,6 +47,10 @@ type Matcher interface {
|
||||
Mappers() (mappers []discovery.URLMapper)
|
||||
}
|
||||
|
||||
type Metrics interface {
|
||||
Middleware(next http.Handler) http.Handler
|
||||
}
|
||||
|
||||
// Timeouts consolidate timeouts for both server and transport
|
||||
type Timeouts struct {
|
||||
// server timeouts
|
||||
@@ -89,7 +94,7 @@ func (h *Http) Run(ctx context.Context) error {
|
||||
h.signatureHandler(),
|
||||
h.pingHandler,
|
||||
h.healthMiddleware,
|
||||
// R.Headers(h.ProxyHeaders...),
|
||||
h.Metrics.Middleware,
|
||||
h.headersHandler(h.ProxyHeaders),
|
||||
h.accessLogHandler(h.AccessLog),
|
||||
h.stdoutLogHandler(h.StdOutEnabled, logger.New(logger.Log(log.Default()), logger.Prefix("[INFO]")).Handler),
|
||||
|
||||
Reference in New Issue
Block a user