updates go dependencies, refactors config loading precedence, adds gRPC gateway path stripping option, and improves HTTP handler setup.
This commit is contained in:
@@ -64,6 +64,9 @@ func prepHTTPServer(opts *opts.AppHTTP) *http.Server {
|
||||
if h.Pattern != "" && h.Prefix != "" {
|
||||
l.Fatal().Str("ExactPath", h.Pattern).Str("Prefix", h.Prefix).
|
||||
Msg("Can't have both pattern and prefix match for http handler")
|
||||
} else if h.Pattern == "" && h.Prefix == "" {
|
||||
l.Fatal().Str("ExactPath", h.Pattern).Str("Prefix", h.Prefix).
|
||||
Msg("Must have prefix or pattern for http handler")
|
||||
}
|
||||
|
||||
if h.Prefix != "" {
|
||||
@@ -82,7 +85,7 @@ func prepHTTPServer(opts *opts.AppHTTP) *http.Server {
|
||||
servePath = h.Pattern
|
||||
}
|
||||
|
||||
mux.Handle(h.Prefix, otelhttp.WithRouteTag(servePath, h.Handler))
|
||||
mux.Handle(servePath, otelhttp.NewHandler(h.Handler, servePath))
|
||||
}
|
||||
|
||||
// Add OTEL instrumentation, filter noise, set span names
|
||||
|
||||
Reference in New Issue
Block a user