feat(contrib): add labstack/echo v5 integration#4648
Conversation
Adds tracing support for labstack/echo v5, adapting the existing v4 integration to the new echo v5 API (struct-based Context, new router interface, Binder-level AppSec body monitoring).
3a24efc to
5393d54
Compare
BenchmarksBenchmark execution time: 2026-04-09 14:57:09 Comparing candidate commit 5393d54 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 216 metrics, 8 unstable metrics.
|
What does this PR do?
Adds a new
contrib/labstack/echo.v5package providing tracing and AppSec support for labstack/echo v5.The integration is adapted from the existing
contrib/labstack/echo.v4package with the following v5-specific changes:echo.Contextis now a struct (*echo.Context) instead of an interfacec.Response()returnshttp.ResponseWriter— useecho.UnwrapResponse()to access the underlying*echo.Responseand itsStatusfieldParamNames()replaced byc.PathValues()([]PathValue{Name, Value})OnAddRouteHandlerreplaced byOnAddRoute func(Route) errorNewHTTPError(code, message string)— single string message instead of variadicinterface{}HTTPErrorHandlersignature changed tofunc(*Context, error)Any()registers a single route withecho.RouteAnymethod instead of per-method routesc.Error()method — error status written directly viac.JSON()in the appsec handler (only when the response isn't yet committed)appsecBinderwrappingecho.Binder(since Context struct can't be wrapped like the v4 interface)echo.HTTPStatusCoderinterface to handle both publicHTTPErrorand internal echo error typesMotivation
Resolves #4433
Echo v5 was released with major breaking changes. Users on v5 need a dedicated contrib integration.
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.