Skip to content

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

@JordiMartinezVicent

Description

@JordiMartinezVicent

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

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestheme: observabilityAn issue related to observability and tracingtype: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions