Open froque opened 1 month ago
Hello, thank you for the report. This is marked as an error because it generates an Exception that is not handled within the scope of the span. You can see that the root span for that request (which is also the one bearing the http response code) is not marked as error. What exactly is the behavior you would like to see ?
I see from the screenshot that you are using error tracking, you can mark the issue as "Ignored" if you don't want to see it in the issues list.
What exactly is the behavior you would like to see ?
Since from the HTTP client perspective the response is a HTTP 400 and not HTTP 5xx, I was expecting Datadog to not mark this as an error.
I see from the screenshot that you are using error tracking, you can mark the issue as "Ignored" if you don't want to see it in the issues list.
I missed that. I am going to try it now.
The thing is that where the error is captured, we just see it as an exception being thrown by a Java service, which we record as an error. We don't have information on the HTTP response code at this point in time. When we handle the actual response code, we see it's a 400 and we do not mark that span as error.
I know it's not your code but an open source project, but maybe the issue is that keycloak is using an Exception to handle code flow in a not-so-exceptional situation, which is something regarded as bad practice when writing Java code. One fix would be to rework that code to use a meaningful return status rather than an exception.
Ok. In that case, perhaps a new config similar to DD_TRACE_CLASSES_EXCLUDE and DD_HTTP_SERVER_ERROR_STATUSES to ignore specific exceptions (DD_TRACE_EXCEPTIONS_EXCLUDE)?
Or even better let us define some Java class that can decide if a specific exception should be regarded as an error or not i.e. by looking into the type, attributes or annotations.
This would also allow for a fix for #7141.
Running keycloak:
make a HTTP request to token endpoint with an expired or invalid refresh token
We initially though this was a problem in Keycloak https://github.com/keycloak/keycloak/issues/29451 fixed by https://github.com/keycloak/keycloak/pull/29649 but now it seems to be a problem in dd-java-agent.