Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

hcelaloner
Copy link
Contributor

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 Zilelierkan.zileli@trendyol.com
Signed-off-by: Celal Öner celal.oner@trendyol.com

Fixes #2209

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 21, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: hcelaloner / name: Hüseyin Celal Öner (db9e99c)

…her 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 <erkan.zileli@trendyol.com>
Signed-off-by: Celal Öner <celal.oner@trendyol.com>
@hcelaloner hcelaloner force-pushed the fix/2209-pass-error-to-other-middlewares-correctly branch from db9e99c to caceaab Compare April 21, 2022 07:00
@hcelaloner hcelaloner marked this pull request as draft April 21, 2022 07:24
@codecov
Copy link

codecov bot commented Apr 27, 2022

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

@hcelaloner
Copy link
Contributor Author

Closing pull request since the issue is now resolved by #3656

@hcelaloner hcelaloner closed this Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OtelEcho swallows the error and does not pass it to other middlewares
3 participants