Discover service.version attribute from Spring Boot's build-info.properties file #9457
Labels
contribution welcome
Request makes sense, maintainers probably won't have time, contribution would be welcome
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
Not really a "problem", but just a minor annoyance that I have to find some alternative way to specify the
service.version
attribute, even though the metadata is available in the application's jar.Describe the solution you'd like
The Spring Boot maven/gradle plugins provide a way to generate a build information for Spring Boot applications. The plugins generate a file named
META-INF/build-info.properties
. For example, the generated file might look like the following:Notice the
build.version
property.It would be great if the spring-boot-resources instrumentation defined a
ResourceProvider
that would set theservice.version
resource attribute from thebuild.version
property found in theMETA-INF/build-info.properties
file.This would make version discovery automatic for Spring Boot applications that already include build info.
Describe alternatives you've considered
alternative 1:
Manually set the
service.version
resource attribute.alternative 2:
A more-generic
ResourceProvider
could be created that takes the name of a class as input, and then retrieves its version information viaclazz.getPackage().getImplementationVersion()
, which pulls info from its jar's META-INF/MANIFEST.MF.This alternative is not as "automatic" as using the Spring Boot
build-info.properties
file, since it requires additional input. But it would support any Java application (assuming the metadata is in its manifest). Not just Spring Boot apps.Additional context
No response
The text was updated successfully, but these errors were encountered: