◆ NFRGate / Rule Reference

T4 — Errors marked on the span

medium 🔍 traces · both

When an external call fails, the span's status is explicitly set to error, not just logged separately, so trace-based error views pick it up.

Python Implementation

T4: when an external call fails, the span's status is explicitly set to
error — not just logged separately — so trace-based error views pick it up.
rubric_store/definitions/traces.yaml tags this `both`; the static half only
applies when there's a span to mark in the first place (is_wrapped_in_span),
and checks for a set_status(...) or record_exception(...) call — the two
standard OTel APIs for marking a span's error state — anywhere in the catch
block that handles the failure.

Java Implementation

T4 for Java: when an external call fails, the span's status is
explicitly set to error. Only applies when there's a span to mark
(is_wrapped_in_span), and checks the catch block for a `.setStatus(...)` or
`.recordException(...)` call — the two standard OTel Java API calls for
marking a span's error state.

Go Implementation

T4 for Go: when an external call fails, the span's status is explicitly
set to error. Only applies when a span was started earlier in this function
(is_wrapped_in_span, reusing T1/R1's textual-precedence check), and checks
the `if err != nil` block for a `.RecordError(...)` or `.SetStatus(...)`
call — Go OTel API's names for marking a span's error state.
← All rules