Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultServerRequestObservationConvention throws when response status is zero #33725

Closed
fisco-unimatic opened this issue Oct 16, 2024 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing type: bug A general bug
Milestone

Comments

@fisco-unimatic
Copy link

DefaultServerRequestObservationConvention#outcome tests whether the response is null, and if so, returns HTTP_OUTCOME_UNKNOWN.
Otherwise, it gets the HttpOutcome for the HttpStatusCode for the HttpServletResponse#getStatus.
Somehow, HttpServletResponse#getStatus is coming through as zero in my application (I don't know what implementation of HttpServletResponse this is - I can't see the code of the platform I'm running on - the implementations I can find default to 200), which causes HttpStatusCode#valueOf to throw an

IllegalArgumentException: Status code '0' should be a three-digit positive integer

I propose that DefaultServerRequestObservationConvention#outcome should catch this exception and return HTTP_OUTCOME_UNKNOWN. I can make a pull request if you want.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 16, 2024
@jhoeller jhoeller added in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing labels Oct 16, 2024
@bclozel bclozel self-assigned this Oct 18, 2024
@bclozel bclozel added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 18, 2024
@bclozel bclozel added this to the 6.1.15 milestone Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants