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

Wrong observation status tag when a Not Found in a webflux application #31703

Closed
JordiMartinezVicent opened this issue Nov 28, 2023 · 4 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches theme: observability An issue related to observability and tracing type: regression A bug that is also a regression
Milestone

Comments

@JordiMartinezVicent
Copy link

Spring Boot Version: 3.1.6

Given a webflux application with metrics enabled, when a request is done to a non existing endpoint, the status tag is 200, instead of 404 (not found)

I have attached a sample application.
webflux-metrics.zip

To reproduce the issue

http_server_requests_seconds_count{error="ResponseStatusException",exception="ResponseStatusException",method="GET",outcome="SUCCESS",status="200",uri="/**",} 1.0
http_server_requests_seconds_sum{error="ResponseStatusException",exception="ResponseStatusException",method="GET",outcome="SUCCESS",status="200",uri="/**",} 0.005408

Notice the tag status="200"

Notice that with SpringBoot 3.1.5, it works correctly, having the status=404

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 28, 2023
@bclozel bclozel self-assigned this Nov 28, 2023
@bclozel
Copy link
Member

bclozel commented Nov 28, 2023

This is due to a regression introduced by #31417.

@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression theme: observability An issue related to observability and tracing and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 28, 2023
@bclozel bclozel added this to the 6.0.15 milestone Nov 28, 2023
@JordiMartinezVicent
Copy link
Author

@bclozel there would be some kind of workaround until the 6.0.15 is released?

@bclozel bclozel modified the milestones: 6.0.15, 6.1.2 Nov 28, 2023
@bclozel
Copy link
Member

bclozel commented Nov 28, 2023

@JordiMartinezVicent there is no workaround yet as I haven't found a proper fix for this issue and #31706 which is related.

@bclozel
Copy link
Member

bclozel commented Nov 29, 2023

@JordiMartinezVicent the problem is fixed now and should be available soon in 6.1.2-SNAPSHOT and 6.0.15-SNAPSHOT.

I haven't found a simple workaround before the release. I think the only alternatives are:

  • subclassing ServerHttpObservationFilter and applying the changes I made, and declaring it as a bean in your Spring Application
  • using Spring Framework SNAPSHOTs

Release dates are already scheduled and we have quite a few fixes for regressions and issues lined up.

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) status: backported An issue that has been backported to maintenance branches theme: observability An issue related to observability and tracing type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants