diff --git a/.chloggen/1414-adjust-gin-config.yaml b/.chloggen/1414-adjust-gin-config.yaml new file mode 100644 index 0000000000..95c455ab49 --- /dev/null +++ b/.chloggen/1414-adjust-gin-config.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action) +component: "target allocator" + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Configure `gin` router to be used in release mode and do not use the default logging middleware which is noisy and not formatted properly." + +# One or more tracking issues related to the change +issues: [1352] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: \ No newline at end of file diff --git a/cmd/otel-allocator/server/server.go b/cmd/otel-allocator/server/server.go index c93cfe3514..fe769bb4ec 100644 --- a/cmd/otel-allocator/server/server.go +++ b/cmd/otel-allocator/server/server.go @@ -67,7 +67,9 @@ func NewServer(log logr.Logger, allocator allocation.Allocator, listenAddr *stri allocator: allocator, } - router := gin.Default() + gin.SetMode(gin.ReleaseMode) + router := gin.New() + router.Use(gin.Recovery()) router.UseRawPath = true router.UnescapePathValues = false router.Use(s.PrometheusMiddleware)