Specify error.type on OpenTelemetry command spans

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Component/s: Observability
    • None
    • Needed
    • Hide

      Summary of necessary driver changes

      •  

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      •  

      Context for other referenced/linked tickets

      •  
      Show
      Summary of necessary driver changes   Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed)   Context for other referenced/linked tickets  
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-6434 Blocked
      CXX-3561 Blocked
      CSHARP-6196 Blocked
      GODRIVER-4100 Blocked
      JAVA-6289 Blocked
      NODE-7777 Blocked
      PYTHON-6045 In Code Review
      PHPLIB-1934 Blocked
      RUBY-3945 Blocked
      RUST-2480 Blocked
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } #scriptField td.willNotDo { background-color: #FF0000; /* Red color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-6434 Blocked CXX-3561 Blocked CSHARP-6196 Blocked GODRIVER-4100 Blocked JAVA-6289 Blocked NODE-7777 Blocked PYTHON-6045 In Code Review PHPLIB-1934 Blocked RUBY-3945 Blocked RUST-2480 Blocked

      Specify error.type on OpenTelemetry command spans

      Summary

      The spec defines db.response.status_code on command spans but not error.type, which the technical design lists alongside it at the same requirement level. Leaving it out was deliberate, because it duplicates exception.type. However the two are different kinds of thing: exception.type is an attribute on the exception event, while error.type is a span attribute. Following the OpenTelemetry semantic conventions verbatim means adding error.type and accepting that duplication.

      Motivation

      Who is the affected end user?

      Driver teams implementing the spec, and application developers who filter or aggregate traces by error class.

      How does this affect the end user?

      error.type is the dimension OpenTelemetry backends group and alert on for failures. Carried only as an exception-event attribute, it cannot be queried at the span level. Drivers that emit it anyway have no shared definition of its value, so the same failure is labelled differently per language.

      How likely is it that this problem or use case will occur?

      Every failed command.

      If the problem does occur, what are the consequences and how severe are they?

      Moderate. No data or availability risk. Failure dashboards and alerting behave differently per driver, and a driver that adds the attribute later changes the shape of its traces.

      Is this issue urgent?

      No.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      No. The attribute and its value have to be specified; a test alone would make one reading normative.

      Acceptance Criteria

      • The Command Span Attributes table lists error.type as a string, required if an error happens, matching how db.response.status_code is listed.
      • The spec states the value: error.type SHOULD match db.response.status_code when the command failed with a server error, and otherwise SHOULD be the class name of the exception.
      • The spec states that error.type MUST NOT be set when the command succeeds, and SHOULD have a low number of distinct values, per the semantic conventions.
      • The spec states that error.type is a span attribute that deliberately duplicates information carried by exception.type on the exception event, and why: backends query the span dimension rather than the event.
      • The spec states whether error.type applies to operation spans as well as command spans.
      • A test covers a failing command carrying the attribute. In the server-error case the value is assertable, since it matches db.response.status_code; in the non-server-error case it is language specific, so only presence and type can be asserted.
      • open-telemetry.md has a dated changelog entry.

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Nabil Hachicha Nabil Hachicha
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: