fix(auth): skip expected missing-header telemetry#2645
Conversation
Missing auth headers are a normal unauthorized path, so avoid reporting ErrNoAuthHeader as an error while preserving telemetry for unexpected header parsing failures.
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 1c01dff. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1c01dff. Configure here.
| ) | ||
| if !errors.Is(err, ErrNoAuthHeader) { | ||
| telemetry.ReportError(ctx, | ||
| "authorization header is missing", |
There was a problem hiding this comment.
Telemetry message misleading after conditional skip
Low Severity
The telemetry.ReportError message "authorization header is missing" now only fires for ErrInvalidAuthHeader (malformed header), since ErrNoAuthHeader is explicitly excluded by the new guard. The telemetry event description no longer matches the actual error condition — it will misleadingly report "missing" when the header was present but malformed.
Reviewed by Cursor Bugbot for commit 1c01dff. Configure here.
❌ 4 Tests Failed:
View the full list of 7 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Code Review
The telemetry message "authorization header is missing" is incorrect because the logic now ensures the error is not ErrNoAuthHeader. The message should be updated to "authorization header is invalid" to correctly reflect the state when ErrInvalidAuthHeader is returned.
| ) | ||
| if !errors.Is(err, ErrNoAuthHeader) { | ||
| telemetry.ReportError(ctx, | ||
| "authorization header is missing", |
There was a problem hiding this comment.
The telemetry message "authorization header is missing" is incorrect because the preceding check ensures the error is not ErrNoAuthHeader. The message should be updated to "authorization header is invalid" to correctly reflect the state when ErrInvalidAuthHeader is returned.
| "authorization header is missing", | |
| "authorization header is invalid", |


Missing auth headers are a normal unauthorized path, so avoid reporting ErrNoAuthHeader as an error while preserving telemetry for unexpected header parsing failures.