Defines the controller api metrics and registers them at controller startup (#1917)

Co-authored-by: Hugo Vieira <hugoamvieira@users.noreply.github.com>
This commit is contained in:
ToddandHugo Vieira authored and GitHub committed 2022-03-31 08:48:50 -07:00
1 parent 1bb2c5983d
commit 3eb22b073a
16 files changed
+1128 -16

No files matched your search

+6 -1
View File
@@ -38,6 +38,7 @@ import (
"github.com/hashicorp/boundary/internal/servers/controller/handlers/sessions"
"github.com/hashicorp/boundary/internal/servers/controller/handlers/targets"
"github.com/hashicorp/boundary/internal/servers/controller/handlers/users"
"github.com/hashicorp/boundary/internal/servers/controller/internal/metric"
"github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/go-secure-stdlib/listenerutil"
"github.com/hashicorp/go-secure-stdlib/strutil"
@@ -72,8 +73,12 @@ func (c *Controller) apiHandler(props HandlerProperties) (http.Handler, error) {
callbackInterceptingHandler := wrapHandlerWithCallbackInterceptor(commonWrappedHandler, c)
printablePathCheckHandler := cleanhttp.PrintablePathCheckHandler(callbackInterceptingHandler, nil)
eventsHandler, err := common.WrapWithEventsHandler(printablePathCheckHandler, c.conf.Eventer, c.kms, props.ListenerConfig)
if err != nil {
return nil, err
}
metricsHandler := metric.InstrumentApiHandler(eventsHandler)
return eventsHandler, err
return metricsHandler, nil
}
// GetHealthHandler returns a gRPC Gateway mux that is registered against the