Skip to content

WebFlux server metrics record http status 200 for CancelledServerWebExchangeException #29599

Closed
@lhahne

Description

@lhahne

Version: Spring Boot 2.6.3.RELEASE with Webflux & Metrics

Scenario

  • Client aborts the connection before server sends a response.
  • Server request processing takes forever (server configured with read/write timeout). Server closes the connection

In both the above cases, metrics are generated. However they are stored with status = 200 implying success. Eg:

http_server_requests_seconds{app="test-v0",cid="",exception="CancelledServerWebExchangeException",host="xxx",method="GET",outcome="UNKNOWN",springBoot="2",status="200",uri="/slow",ver="0.0.1",quantile="0.5",} 0.872415232

Please see earlier issue #23606 for reference source code.

The correct status code for this situation is clearly not well defined. However by making it 200, the result looks like success if we monitor fot HTTP Status code. Something from the 400 series would suit this better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions