spring-projects / spring-projects/spring-security

Spring Security creates inconsistent spans for Actuator endpoints on management port in Spring MVC

Open
#18,531 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: bug
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Describe the bug
When a Spring Boot application is configured with a dedicated management port (management.server.port), HTTP requests to Actuator endpoints are not correctly traced (or not traced at all) when using Micrometer Tracing / OpenTelemetry.

This issue only occurs in a Servlet-based application using spring-web / Spring MVC.
The same configuration works correctly with Spring WebFlux, where actuator endpoints exposed on a dedicated management port are properly traced.

When Actuator runs on the same port as the main application (server.port), tracing works as expected in both cases.

This issue only affects Actuator endpoints exposed on the management port; regular application endpoints are traced correctly.

Both Spring Boot 3.5.9 and 4.0.1 contains the same issue.

To Reproduce
https://github.com/guerricm/demo-secu-observability/blob/main/README.md

Expected behavior
Actuator endpoints should be traced consistently, regardless of whether they are exposed on the main application port or on a dedicated management port, for both Spring MVC and Spring WebFlux applications.

Sample
https://github.com/guerricm/demo-secu-observability

--
A working Spring WebFlux version is available on the webflux branch:
https://github.com/guerricm/demo-secu-observability/blob/webflux/README.md

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked demo README and reproduce the issue using a Servlet-based Spring MVC application with management.server.port configured. Compare the behavior with the webflux branch and with Actuator on the main port; done means Actuator endpoints on a dedicated management port produce consistent tracing in both configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, observability, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.