Skip to content

Actuator metrics reports 200 instead of 201 when DeferredResult is used #4098

@n1ko-w1ll

Description

@n1ko-w1ll

Hi,

In one of our projects we discoverd an issue with the metrics counts. I extracted a relevant example here: https://github.com/n1ko-w1ll/SpringBootActuatorIssue

Problem: If the return type is DeferredResult<ResponseEntity<?>>, the counted status code is 200 even if you set the result to new ResponseEntity<>(HttpStatus.CREATED). Without the DeferredResult everything works as expected.

UPDATE:

the output of the metrics endpoint after 1 POST to /create looks like this:

{
  ...
  "counter.status.200.create": 1,
  ...
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions