Service name resolution using spring.application.name
doesn't support multi-document properties
#13206
Labels
spring.application.name
doesn't support multi-document properties
#13206
Describe the bug
SpringBootServiceNameDetector
supports resolving service name fromapplication.properties
but is not aware of Spring Boot's support for multi-document properties - see Working With Multi-Document Files section of Spring Boot's reference manual. Multi-document properties allow the same configuration property to be present multiple times insideapplication.properties
and the actual resolved value is dependent on some condition, for example:With such
application.properties
,SpringBootServiceNameDetector
will always resolve service name toproduct2-backend
regardless of the currently active profile.Relevant documentation does not mention this being a known limitation.
Note that this might also affect
application.yaml
but I didn't confirm.Steps to reproduce
application.properties
set up like aboveExpected behavior
Resolved service name would be the one actually in use taking account conditions.
Actual behavior
Resolved service name doesn't take into account conditions and resolves service name from last occurrence of
spring.application.name
inapplication.properties
.Javaagent or library instrumentation version
v2.12.0
Environment
n/r
Additional context
n/a
The text was updated successfully, but these errors were encountered: