Skip to content

LegacySpanProcessorInstrumentation has a bug in reporting the "processedSpans" metric #8142

@wglad

Description

@wglad

Describe the bug
LegacySpanProcessorInstrumentation.finishSpans() method has an inverted check for "no error" which prevents it from correctly reporting the "processedSpans" metric.

  @Override
  public void finishSpans(int count, @Nullable String error) {
    // Legacy metrics only record when no error.
    if (error != null) { // <--- **This is wrong. The if condition must be changed to: "error == null"**
      processedSpans().add(count, standardAttrs);
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions