Skip to content

Manually set errors being overridden by HTTP Status code check #5307

@anishitani

Description

@anishitani

Span errors set by the server seems to be overridden in method HttpServerDecorator.onResponseStatus(), which set the span error configuration base solely on the DD_HTTP_SERVER_ERROR_STATUSES property.

I believe considering the previous span error value in the setError logic should keep changes made to the span at the server.

if (!span.isError && !BlockingException.class.getName().equals(span.getTag("error.type"))) {
      span.setError(SERVER_ERROR_STATUSES.get(status));
}

Or rollback to something like version 1.12.1 implementation:

if (!BlockingException.class.getName().equals(span.getTag("error.type")) && SERVER_ERROR_STATUSES.get(status)) {
      span.setError(true);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions