-
Notifications
You must be signed in to change notification settings - Fork 161
gen: Wrong span error condition in handlers template #1476
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What version of ogen are you using?
v1.14.0
Can this issue be reproduced with the latest version?
Yes
What did you do?
Generated server code with OpenTelemetry enabled. The handlers template has incorrect span error condition at line 109:
if code >= 100 && code < 500 {
span.SetStatus(codes.Error, stage)
}What did you expect to see?
According to OpenTelemetry conventions, server spans should only be marked as Error for invalid codes (< 100) or server errors (>= 500):
if code < 100 || code >= 500 {
span.SetStatus(codes.Error, stage)
}What did you see instead?
The current code incorrectly marks 2xx, 3xx, and 4xx responses as errors, violating OpenTelemetry HTTP semantic conventions and creating false error signals in telemetry data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working