Skip to content

feat(contrib): add labstack/echo v5 integration#4648

Draft
genesor wants to merge 1 commit intomainfrom
ben.db/feat-echo-v5-support
Draft

feat(contrib): add labstack/echo v5 integration#4648
genesor wants to merge 1 commit intomainfrom
ben.db/feat-echo-v5-support

Conversation

@genesor
Copy link
Copy Markdown
Member

@genesor genesor commented Apr 9, 2026

What does this PR do?

Adds a new contrib/labstack/echo.v5 package providing tracing and AppSec support for labstack/echo v5.

The integration is adapted from the existing contrib/labstack/echo.v4 package with the following v5-specific changes:

  • echo.Context is now a struct (*echo.Context) instead of an interface
  • c.Response() returns http.ResponseWriter — use echo.UnwrapResponse() to access the underlying *echo.Response and its Status field
  • ParamNames() replaced by c.PathValues() ([]PathValue{Name, Value})
  • OnAddRouteHandler replaced by OnAddRoute func(Route) error
  • NewHTTPError(code, message string) — single string message instead of variadic interface{}
  • HTTPErrorHandler signature changed to func(*Context, error)
  • Any() registers a single route with echo.RouteAny method instead of per-method routes
  • No c.Error() method — error status written directly via c.JSON() in the appsec handler (only when the response isn't yet committed)
  • AppSec body monitoring via appsecBinder wrapping echo.Binder (since Context struct can't be wrapped like the v4 interface)
  • Uses echo.HTTPStatusCoder interface to handle both public HTTPError and internal echo error types

Motivation

Resolves #4433

Echo v5 was released with major breaking changes. Users on v5 need a dedicated contrib integration.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running make lint locally.
  • New code doesn't break existing tests. You can check this by running make test locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.

@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Apr 9, 2026
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).
@genesor genesor force-pushed the ben.db/feat-echo-v5-support branch from 3a24efc to 5393d54 Compare April 9, 2026 14:31
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Apr 9, 2026

Benchmarks

Benchmark execution time: 2026-04-09 14:57:09

Comparing candidate commit 5393d54 in PR branch ben.db/feat-echo-v5-support with baseline commit 747b2e5 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 216 metrics, 8 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apm:ecosystem contrib/* related feature requests or bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant