Loading...
32

I want to use Spring Boot Actuator to monitor my application in production. I added the dependency but all endpoints are exposed.

How do I:

  1. Enable only specific endpoints (health, info, metrics)

  2. Secure them with authentication

  3. Change the base path from /actuator


Any best practices for production?

asked 4 days ago
boot_dev 850

Log in to add a comment.

1 Answer

24

Here's how to configure Actuator properly for production:

application.yml:
__CODEBLOCK0

*Security Configuration:*
CODEBLOCK1__

Best Practices:

    1. Never expose env, beans, or heapdump in production
    2. Use a separate port or IP whitelist
    3. Enable Prometheus endpoint for monitoring
    4. Always use HTTPS

answered 3 days ago
micro_king 1.2k
Log in to answer this question.
Question Stats
Asked: 4 days ago
Views: 891
Active: 1 day ago
Related Tags