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
Question: Datadog trace for echo is giving useless trace stack for 4xx and 5xx status code. #987
Comments
I might be wrong, but I believe this line of the stack
refers to your handler defined in subGroup.Add("GET", "/foo/:bar", func(c echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, "my error message")
}) Its not clear because its an anonymous function. Try defining a actual function and check the stack again. Something like subGroup.Add("GET", "/foo/:bar", fooHandler)
func fooHandler(c echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, "my error message")
} |
I try the actual function and the stack looks the same.
The stack doesn't show my handler. |
Hi, @ckyko.
The information is presented in two places in the UI, but the information is not duplicated in the span (there is only one copy of the data being sent from the application). The UI just chooses to display the error tag specially. You can consider using the If that's not an acceptable solution, we can add an |
Thanks, I don't think disabling stack traces for the entire program is a good solution. I would expect there is an option to disable the stack traces when the traces are completely unhelpful. |
I looked more closely into this. Aside from the stack traces not being useful, the echo integration is doing some things wrongly that it shouldn't:
Unfortunately, we can't know the final value of the status code or the final error, but we can make a good guess based on what is returned from the downstream middleware and handlers. |
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) or non-errors (4xx and below) Fixes #987
Any resolution on this? We're trying to clean up our APM and only have 500s for our echo implementation. Happy to help in any way to get the PR merged. |
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) or non-errors (4xx and below) Fixes #987
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) or non-errors (4xx and below) Fixes #987
Hi, I am using Datadog trace for my go echo server. And, I saw there is a trace stack for 4xx and 5xx status codes on the Datadog APM traces tag tab. But, looks like it is showing the same error stack. And, it is not my error stack. Looks like it is the trace stack where we set the error-tag.
Should we show it if it is not the real error trace stack? Is there any way to disable it for the wrong error trace stack?
Also, I saw the error trace stack on both 'error' tab and 'tag' tab, is it duplicate information?
The trace stack on the Datadog APM traces:
Here is the code to generate the trace stack:
dd-trace-go/contrib/labstack/echo.v4/echotrace.go
Line 55 in d326bfb
dd-trace-go/ddtrace/tracer/span.go
Line 107 in d326bfb
The text was updated successfully, but these errors were encountered: