Skip to content

Multiple traces are generated for failing requests #12610

Open
@MatthiasDrews

Description

@MatthiasDrews

Describe the bug
When a REST request fails, duplicate traces are generated. This behavior exists for authentication errors (e.g. unauthenticated -> 401), as well as for other errors dispatching to the error page (e.g. wrong URL -> 404).
It seems that requests which are dispatched to the error page by the framework, get a fresh observation and thus traceId, instead of taking any existing observation which was generated by the initial request handling.

The result in Grafana looks similar to this:
example with 404
error-traces

Tested with SpringBoot 3.0.2, Spring Security 6.0.1

To Reproduce
Fire a request against a secured RestController method, without authentication token.
or
Fire a request with a wrong URL which will result in a 404.

Expected behavior
A single traceId should be generated, dispatched requests should reuse the original traceId

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions