Skip to content

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

Open

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);
}

Activity

  1. RenanSFreitas commented on Jun 6, 2023

    @RenanSFreitas

    Giving a bit more context to this issue, this behavior seems to have been introduced on this commit.

    It could be considered worthy of review, because an user of Datadog could decide to set an error on a span programatically and observe no effect, which is unexpected IMHO.

  2. amarziali commented on Jun 13, 2023

    @amarziali
    Contributor

    Should be fixed by #5359 scheduled for next release

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

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