dd-trace-go icon indicating copy to clipboard operation
dd-trace-go copied to clipboard

contrib/labstack/{echo, echo.v4}: improve error detection

Open knusbaum opened this issue 4 years ago • 4 comments
trafficstars

This adds improved error detection to the echo integrations. Previously, any returned error was recorded as an error in the echo span. This patch causes the integration to inspect the returned error to determine if it is a echo.HTTPError which it can use to discriminate between real errors (5xx and up by default) or non-errors (below 5xx by default)

This also adds a WithStatusCheck Option which allows users to configure which errors/statuses are reported as errors.

Fixes #987

knusbaum avatar Sep 08 '21 18:09 knusbaum

Manually tested, but need to add unit tests for this.

knusbaum avatar Sep 08 '21 18:09 knusbaum

Done, ready.

knusbaum avatar Sep 08 '21 18:09 knusbaum

Moving to 1.35.0. Hope that's ok. Otherwise ping me.

gbbr avatar Oct 20 '21 10:10 gbbr

LGTM 👍

I'm looking forward to merging.

Is there anything I can do ?

sawadyecma avatar Nov 26 '21 09:11 sawadyecma

Benchmarks

Comparing candidate commit 649a37b8dc775bda4a56efc8c079900e8d947376 in PR branch knusbaum/fix-echo with baseline commit 2f1555e66a44c8ad8ae2a0877ee6fb3109051e92 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 6 cases.

pr-commenter[bot] avatar Dec 08 '22 19:12 pr-commenter[bot]