diff --git a/internal/api/grpc/server/gateway.go b/internal/api/grpc/server/gateway.go index 327865bd6c..25b4c6996a 100644 --- a/internal/api/grpc/server/gateway.go +++ b/internal/api/grpc/server/gateway.go @@ -20,8 +20,10 @@ import ( client_middleware "github.com/zitadel/zitadel/internal/api/grpc/client/middleware" "github.com/zitadel/zitadel/internal/api/grpc/server/middleware" + http_utils "github.com/zitadel/zitadel/internal/api/http" http_mw "github.com/zitadel/zitadel/internal/api/http/middleware" "github.com/zitadel/zitadel/internal/query" + "github.com/zitadel/zitadel/internal/telemetry/metrics" ) const ( @@ -206,7 +208,10 @@ func addInterceptors( // For some non-obvious reason, the exhaustedCookieInterceptor sends the SetCookie header // only if it follows the http_mw.DefaultTelemetryHandler handler = exhaustedCookieInterceptor(handler, accessInterceptor) - handler = http_mw.DefaultMetricsHandler(handler) + handler = http_mw.MetricsHandler([]metrics.MetricType{ + metrics.MetricTypeTotalCount, + metrics.MetricTypeStatusCode, + }, http_utils.Probes...)(handler) return handler } diff --git a/internal/api/http/middleware/metrics_interceptor.go b/internal/api/http/middleware/metrics_interceptor.go index 32a84f4b15..4b239b8c12 100644 --- a/internal/api/http/middleware/metrics_interceptor.go +++ b/internal/api/http/middleware/metrics_interceptor.go @@ -3,15 +3,9 @@ package middleware import ( "net/http" - http_utils "github.com/zitadel/zitadel/internal/api/http" "github.com/zitadel/zitadel/internal/telemetry/metrics" ) -func DefaultMetricsHandler(handler http.Handler) http.Handler { - metricTypes := []metrics.MetricType{metrics.MetricTypeTotalCount} - return MetricsHandler(metricTypes, http_utils.Probes...)(handler) -} - func MetricsHandler(metricTypes []metrics.MetricType, ignoredMethods ...string) func(http.Handler) http.Handler { return func(handler http.Handler) http.Handler { return metrics.NewMetricsHandler(handler, metricTypes, ignoredMethods...)