natchez icon indicating copy to clipboard operation
natchez copied to clipboard

OpenTelemetry module should record canceled spans as errors

Open bpholt opened this issue 5 months ago • 0 comments

I think it's misleading to record canceled spans using StatusCode.UNSET. The spec says

The default value is Unset. A span status that is Unset means that the operation it tracked successfully completed without an error.

but a canceled span did not successfully complete. There's no canceled status in the spec, so I think StatusCode.ERROR is the more appropriate choice.

This came up as I was looking at some trace data this afternoon and initially thought a bunch of parallel operations succeeded, with only one failure. Only after more investigation did I realize that the failure actually resulted in the other operations being canceled; none of them actually completed successfully. This would have been immediately obvious if the canceled operations had the Error status set.

bpholt avatar Jul 28 '25 23:07 bpholt