To retrieve the entire environment, make a GET request to /actuator/env, as shown in the following curl-based example:
Now from Spring boot version 3, by default the value of all properties are hidden. To display the value in /env endpoint, below configuration needs to be added in application.properties file. management.endpoint.env.show-values=ALWAYS Valid values for the Property is as below
A quick intro to Spring Boot Actuators – using and extending the existing ones, configuration and rolling your own.
The /actuator/env endpoint is enabled. This endpoint displays the environment properties of your application, including system environment variables, command-line arguments, application-specific configuration (from application.properties, YAML files, etc.), and profile-specific properties. When false The /actuator/env endpoint is disabled, meaning it won’t be accessible.
Spring Boot Actuator provides production-ready features for monitoring and managing your application. This guide shows you how to configure Actuator endpoints effectively for development and production environments. Actuator exposes endpoints that let you monitor application health, view metrics, check environment properties, and more.
To see all properties in your Spring Boot application, enable the Actuator endpoint called env. This enables an HTTP endpoint which shows all the properties of your application’s environment.
Real-Time Use Cases Monitoring: Use /actuator/metrics to collect memory usage, CPU load, and thread count. Health Checks: Use /actuator/health to ensure the application is up and running. Debugging: Use /actuator/loggers to view or change logging levels dynamically. Configuration: Use /actuator/env to inspect environment properties.
Changing Spring Boot Env Properties at Runtime Everyone using Spring Boot knows how convenient it is to configure app via “`application.properties“` file. It has multiple use-cases: configuring …
Spring Boot 3 Actuator example to discuss default auto-configuration and monitor and manage our applications in a production-ready manner.