What are some of the endpoints exposed by Spring Boot Actuator?

ghz 9months ago ⋅ 60 views

Spring Boot Actuator exposes a variety of endpoints that provide insights into the health, metrics, configuration, and other runtime information of your Spring Boot application. Here are some of the commonly used endpoints:

  1. /actuator/health: This endpoint provides information about the health status of your application. It indicates whether the application is up and running (UP status) or if there are any health checks failing (DOWN status).
  2. /actuator/info: This endpoint exposes arbitrary application information. You can customize the information provided by configuring info properties in your application's application.properties or application.yml file.
  3. /actuator/metrics: This endpoint provides various metrics about your application's performance, including HTTP request processing metrics, JVM memory usage, garbage collection metrics, thread pool metrics, and more. You can access specific metrics by appending metric names to the URL (e.g., /actuator/metrics/jvm.memory.used).
  4. /actuator/mappings: This endpoint displays a list of all request mappings (i.e., endpoints) defined in your application, along with their corresponding HTTP methods, paths, and controller classes/methods.
  5. /actuator/env: This endpoint exposes information about the application's environment, including system properties, environment variables, configuration properties, and active profiles.
  6. /actuator/loggers: This endpoint allows you to view and modify the logging configuration of your application at runtime. You can view the current log levels of various loggers and adjust them dynamically.
  7. /actuator/threaddump: This endpoint generates and returns a thread dump of your application's JVM, which provides information about the state of all threads in the JVM, including their stack traces and state.
  8. /actuator/auditevents: This endpoint exposes information about auditable events within your application, such as authentication successes and failures.
  9. /actuator/httptrace: This endpoint provides details about HTTP requests processed by your application, including request and response headers, status codes, and timestamps.
  10. /actuator/refresh: This endpoint triggers a refresh of the application's configuration properties from external sources, such as property files or Spring Cloud Config Server.

These are just a few examples of the endpoints exposed by Spring Boot Actuator. You can enable or disable specific endpoints and customize their behavior using configuration properties in your application's application.properties or application.yml file. Additionally, Spring Boot Actuator allows you to implement custom endpoints to expose application-specific metrics or information.