Given a Spring Boot application with the following application.properties configuration:
management.endpoint.info.enabled=true management.endpoints.web.exposure.include=info info.app.name=MyApp info.app.version=1.0.0
What will be the JSON output when accessing /actuator/info?
Think about how Spring Boot nests info properties under the info key in the JSON response.
The info endpoint returns the properties nested under the info key. Custom properties under info.app appear as nested JSON objects. The actual JSON response body contains the app object with its properties.
Which of the following application.properties snippets correctly enables the Info endpoint and exposes it over HTTP?
Remember you must both enable the endpoint and expose it over HTTP.
Option D explicitly enables the Info endpoint and includes it in the web exposure list, making it accessible via HTTP. Other options either disable it or exclude it.
A developer configured the Info endpoint with these properties:
management.endpoint.info.enabled=true management.endpoints.web.exposure.include=info
But when accessing /actuator/info, the response is {}. What is the most likely cause?
Think about what the Info endpoint shows by default if no info properties are set.
The Info endpoint shows an empty JSON object if no custom info properties are defined. Enabling and exposing the endpoint alone does not add any info data.
Which approach correctly adds custom information to the Info endpoint response by code?
Think about how Spring Boot allows programmatic customization of actuator endpoints.
Implementing the InfoContributor interface and overriding the contribute method allows adding custom info data programmatically. Other options either do not integrate with the actuator or are invalid.
Consider a Spring Boot app with two InfoContributor beans defined:
@Component
public class AppInfoContributor implements InfoContributor {
public void contribute(Info.Builder builder) {
builder.withDetail("app", Map.of("name", "AppX"));
}
}
@Component
public class VersionInfoContributor implements InfoContributor {
public void contribute(Info.Builder builder) {
builder.withDetail("version", "2.1.0");
}
}What JSON will /actuator/info return?
Remember that each InfoContributor adds details to the same builder object.
Each InfoContributor adds its details to the shared Info.Builder. The final JSON merges all details at the top level, so both 'app' and 'version' keys appear together.