diff --git a/auth/main.go b/auth/main.go index 856c53f0..a3b4b67f 100644 --- a/auth/main.go +++ b/auth/main.go @@ -31,6 +31,12 @@ import ( ) func ErrorHandler(err error, c echo.Context) { + // otelecho & RequestLoggerWithConfig middleware call c.Error + // otelecho docs: https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho#WithOnError + if c.Response().Committed { + return + } + code := http.StatusInternalServerError var message string diff --git a/transcoder/main.go b/transcoder/main.go index 76bf82a1..a93ecfa5 100644 --- a/transcoder/main.go +++ b/transcoder/main.go @@ -27,6 +27,12 @@ import ( ) func ErrorHandler(err error, c echo.Context) { + // otelecho & RequestLoggerWithConfig middleware call c.Error + // otelecho docs: https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho#WithOnError + if c.Response().Committed { + return + } + code := http.StatusInternalServerError var message string if he, ok := err.(*echo.HTTPError); ok {