opentelemetry-go-contrib icon indicating copy to clipboard operation
opentelemetry-go-contrib copied to clipboard

fix: do not swallow error in otel echo middleware and return it to other middlewares as expected. #2209

Open hcelaloner opened this issue 2 years ago • 2 comments

fix: do not swallow error in otel echo middleware and return it to other middlewares as expected.

Middleware was swallowing the error and it was not passing it to previous middlewares as expected. Also, when we return the error from the middleware, HTTP error handler is called automatically.

Co-authored-by: Erkan Zileli[email protected] Signed-off-by: Celal Öner [email protected]

Fixes #2209

hcelaloner avatar Apr 21 '22 06:04 hcelaloner

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: hcelaloner / name: Hüseyin Celal Öner (db9e99cd27d07c823878eee400166bc3c69e737d)

Codecov Report

Merging #2210 (caceaab) into main (2c65737) will increase coverage by 5.2%. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2210     +/-   ##
=======================================
+ Coverage   69.4%   74.6%   +5.2%     
=======================================
  Files        135       7    -128     
  Lines       6113     316   -5797     
=======================================
- Hits        4244     236   -4008     
+ Misses      1741      67   -1674     
+ Partials     128      13    -115     
Impacted Files Coverage Δ
...entation/github.com/labstack/echo/otelecho/echo.go
instrumentation/net/http/otelhttp/client.go
instrumentation/net/http/otelhttp/version.go
...entation/github.com/gorilla/mux/otelmux/version.go
propagators/ot/version.go
instrumentation/net/http/otelhttp/common.go
...tion/github.com/astaxie/beego/otelbeego/version.go
...adfitz/gomemcache/memcache/otelmemcache/version.go
zpages/spanprocessor.go
...n/github.com/gin-gonic/gin/otelgin/test/version.go
... and 127 more

codecov[bot] avatar Apr 27 '22 16:04 codecov[bot]

Closing pull request since the issue is now resolved by https://github.com/open-telemetry/opentelemetry-go-contrib/pull/3656

hcelaloner avatar Apr 26 '23 05:04 hcelaloner