Add Prometheus metrics for Minio gateway (#5987)

This commit is contained in:
Yaroslav Skopets
2018-05-30 06:43:46 +02:00
committed by Nitish Tiwari
parent 7ac0fccb6e
commit a50cc7e937
2 changed files with 30 additions and 17 deletions

View File

@@ -187,6 +187,9 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
// Add healthcheck router
registerHealthCheckRouter(router)
// Add server metrics router
registerMetricsRouter(router)
// Register web router when its enabled.
if globalIsBrowserEnabled {
logger.FatalIf(registerWebRouter(router), "Unable to configure web browser")
@@ -196,6 +199,8 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
registerAPIRouter(router)
globalHTTPServer = xhttp.NewServer([]string{gatewayAddr}, registerHandlers(router, globalHandlers...), globalTLSCertificate)
globalHTTPServer.UpdateBytesReadFunc = globalConnStats.incInputBytes
globalHTTPServer.UpdateBytesWrittenFunc = globalConnStats.incOutputBytes
// Start server, automatically configures TLS if certs are available.
go func() {