mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:07:31 +00:00
feat: add http_server_return_code_counter metric to gateway (#8173)
# Which Problems Are Solved The metric `http_server_return_code_counter` doesn't record calls to the gRPC gateway. # How the Problems Are Solved The DefaultMetricsHandler that is used for the gPRC gateway doesn't record `http_server_return_code_counter`. Instead of the DefaultMetricsHandler, a custom metrics handler which includes `http_server_return_code_counter` is created for the gRPC gateway # Additional Changes The DefaultMetricsHandler function is removed, as it is no longer used. # Additional Context Reported by a customer --------- Co-authored-by: Silvan <silvan.reusser@gmail.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user