{"id":132031,"date":"2025-03-10T08:39:00","date_gmt":"2025-03-10T06:39:00","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=132031"},"modified":"2025-03-06T20:54:52","modified_gmt":"2025-03-06T18:54:52","slug":"custom-spring-boot-actuator-endpoints","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html","title":{"rendered":"Custom Spring Boot Actuator Endpoints"},"content":{"rendered":"<p>Spring Boot Actuator is a powerful tool that provides production-ready features to monitor and manage your application. It comes with built-in endpoints for health checks, metrics, environment properties, and more. However, in many cases, you may need to extend these capabilities by creating custom endpoints, securing them, or tailoring them to your application&#8217;s specific needs.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/Spring-Boot-Image.jpeg\"><img decoding=\"async\" width=\"310\" height=\"162\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/Spring-Boot-Image.jpeg\" alt=\"\" class=\"wp-image-83574\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/Spring-Boot-Image.jpeg 310w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/11\/Spring-Boot-Image-300x157.jpeg 300w\" sizes=\"(max-width: 310px) 100vw, 310px\" \/><\/a><\/figure>\n<\/div>\n<p>In this article, we\u2019ll explore:<\/p>\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Creating custom health checks and metrics endpoints.<\/strong><\/li>\n<li><strong>Securing actuator endpoints with <a href=\"https:\/\/www.javacodegeeks.com\/2024\/12\/spring-security-6-enhanced-authentication-and-authorization.html\">Spring Security<\/a>.<\/strong><\/li>\n<li><strong>Best practices and opinions from the developer community.<\/strong><\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\">1. Creating Custom Health Checks and Metrics Endpoints<\/h2>\n<h3 class=\"wp-block-heading\">1.1 Custom Health Checks<\/h3>\n<p>Spring Boot Actuator provides a&nbsp;<code>\/health<\/code>&nbsp;endpoint that shows the health status of your application. You can extend this by creating custom health indicators.<\/p>\n<h4 class=\"wp-block-heading\">Example: Custom Health Indicator<\/h4>\n<p>Let\u2019s say you want to check the health of an external service (e.g., a database or an API).<\/p>\n<pre class=\"brush:java\">\nimport org.springframework.boot.actuate.health.Health;\nimport org.springframework.boot.actuate.health.HealthIndicator;\nimport org.springframework.stereotype.Component;\n\n@Component\npublic class ExternalServiceHealthIndicator implements HealthIndicator {\n\n    @Override\n    public Health health() {\n        \/\/ Simulate a check to an external service\n        boolean isServiceUp = checkExternalService();\n\n        if (isServiceUp) {\n            return Health.up().withDetail(\"External Service\", \"Available\").build();\n        } else {\n            return Health.down().withDetail(\"External Service\", \"Unavailable\").build();\n        }\n    }\n\n    private boolean checkExternalService() {\n        \/\/ Logic to check the external service\n        return true; \/\/ Replace with actual check\n    }\n}\n<\/pre>\n<p>When you hit the\u00a0<code>\/actuator\/health<\/code>\u00a0endpoint, you\u2019ll see the custom health indicator in the response:<\/p>\n<pre class=\"brush:js\">\n{\n  \"status\": \"UP\",\n  \"components\": {\n    \"externalService\": {\n      \"status\": \"UP\",\n      \"details\": {\n        \"External Service\": \"Available\"\n      }\n    }\n  }\n}\n<\/pre>\n<h3 class=\"wp-block-heading\">1.2 Custom Metrics<\/h3>\n<p>Spring Boot Actuator integrates with Micrometer, a metrics collection library. You can create custom metrics to track application-specific data.<\/p>\n<h4 class=\"wp-block-heading\">Example: Custom Metric<\/h4>\n<p>Let\u2019s create a custom counter metric to track the number of times a specific method is called.<\/p>\n<pre class=\"brush:java\">\nimport io.micrometer.core.instrument.Counter;\nimport io.micrometer.core.instrument.MeterRegistry;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class MyService {\n\n    private final Counter myCounter;\n\n    public MyService(MeterRegistry registry) {\n        this.myCounter = registry.counter(\"my.custom.counter\");\n    }\n\n    public void doSomething() {\n        \/\/ Business logic\n        myCounter.increment(); \/\/ Increment the counter\n    }\n}\n<\/pre>\n<p>You can view this metric at the&nbsp;<code>\/actuator\/metrics\/my.custom.counter<\/code>&nbsp;endpoint.<\/p>\n<h2 class=\"wp-block-heading\">2. Securing Actuator Endpoints with Spring Security<\/h2>\n<p>Actuator endpoints expose sensitive information about your application, so it\u2019s crucial to secure them. Spring Security can help you restrict access to these endpoints.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3 class=\"wp-block-heading\">2.1 Example: Securing Actuator Endpoints<\/h3>\n<p>Add Spring Security to your project and configure it to secure actuator endpoints.<\/p>\n<h4 class=\"wp-block-heading\">Step 1: Add Dependencies<\/h4>\n<p>Add the following dependencies to your&nbsp;<code>pom.xml<\/code>&nbsp;or&nbsp;<code>build.gradle<\/code>:<\/p>\n<pre class=\"brush:xml\">\n&lt;dependency&gt;\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n    &lt;artifactId&gt;spring-boot-starter-security&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n    &lt;artifactId&gt;spring-boot-starter-actuator&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\n<\/pre>\n<h4 class=\"wp-block-heading\">Step 2: Configure Security<\/h4>\n<p>Create a security configuration class to restrict access to actuator endpoints.<\/p>\n<pre class=\"brush:java\">\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\nimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\nimport org.springframework.security.core.userdetails.User;\nimport org.springframework.security.core.userdetails.UserDetails;\nimport org.springframework.security.core.userdetails.UserDetailsService;\nimport org.springframework.security.provisioning.InMemoryUserDetailsManager;\nimport org.springframework.security.web.SecurityFilterChain;\n\n@Configuration\n@EnableWebSecurity\npublic class SecurityConfig {\n\n    @Bean\n    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {\n        http\n            .authorizeHttpRequests((requests) -&gt; requests\n                .requestMatchers(\"\/actuator\/**\").hasRole(\"ADMIN\") \/\/ Secure actuator endpoints\n                .anyRequest().permitAll()\n            )\n            .httpBasic(); \/\/ Use HTTP Basic authentication\n\n        return http.build();\n    }\n\n    @Bean\n    public UserDetailsService userDetailsService() {\n        UserDetails user = User.withDefaultPasswordEncoder()\n            .username(\"admin\")\n            .password(\"password\")\n            .roles(\"ADMIN\")\n            .build();\n        return new InMemoryUserDetailsManager(user);\n    }\n}\n<\/pre>\n<p>Now, only users with the&nbsp;<code>ADMIN<\/code>&nbsp;role can access actuator endpoints. You can test this by visiting&nbsp;<code>\/actuator\/health<\/code>&nbsp;and providing the credentials (<code>admin\/password<\/code>).<\/p>\n<h2 class=\"wp-block-heading\">3. Best Practices and Opinions<\/h2>\n<h3 class=\"wp-block-heading\">3.1 Best Practices<\/h3>\n<ul class=\"wp-block-list\">\n<li><strong>Limit Exposure<\/strong>: Only expose actuator endpoints that are necessary. Use the\u00a0<code>management.endpoints.web.exposure.include<\/code>\u00a0and\u00a0<code>exclude<\/code>\u00a0properties in\u00a0<code>application.properties<\/code>\u00a0or\u00a0<code>application.yml<\/code>\u00a0to control this.<\/li>\n<\/ul>\n<pre class=\"brush:bash\">\nmanagement:\n  endpoints:\n    web:\n      exposure:\n        include: health,metrics,info\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><strong>Use HTTPS<\/strong>: Always secure actuator endpoints over HTTPS to prevent sensitive data from being intercepted.<\/li>\n<li><strong>Monitor Access<\/strong>: Log access to actuator endpoints and set up alerts for unusual activity.<\/li>\n<li><strong>Customize Health Checks<\/strong>: Add health checks for critical components (e.g., databases, external APIs) to ensure your application is functioning correctly.<\/li>\n<li><strong>Use Micrometer for Metrics<\/strong>: Leverage Micrometer to integrate with monitoring systems like Prometheus, Grafana, or Datadog.<\/li>\n<\/ul>\n<p>To illustrate them better we present the best practises into a table format as well<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<thead>\n<tr>\n<th><strong>Best Practice<\/strong><\/th>\n<th><strong>Description<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Limit Exposure<\/strong><\/td>\n<td>Only expose necessary actuator endpoints using&nbsp;<code>management.endpoints.web.exposure.include<\/code>&nbsp;and&nbsp;<code>exclude<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><strong>Use HTTPS<\/strong><\/td>\n<td>Secure actuator endpoints over HTTPS to prevent sensitive data interception.<\/td>\n<\/tr>\n<tr>\n<td><strong>Monitor Access<\/strong><\/td>\n<td>Log access to actuator endpoints and set up alerts for unusual activity.<\/td>\n<\/tr>\n<tr>\n<td><strong>Customize Health Checks<\/strong><\/td>\n<td>Add health checks for critical components (e.g., databases, external APIs).<\/td>\n<\/tr>\n<tr>\n<td><strong>Use Micrometer for Metrics<\/strong><\/td>\n<td>Integrate with monitoring systems like Prometheus, Grafana, or Datadog.<\/td>\n<\/tr>\n<tr>\n<td><strong>Role-Based Access Control<\/strong><\/td>\n<td>Restrict access to actuator endpoints using roles (e.g.,&nbsp;<code>ADMIN<\/code>).<\/td>\n<\/tr>\n<tr>\n<td><strong>Regularly Update Dependencies<\/strong><\/td>\n<td>Keep Spring Boot, Actuator, and Spring Security dependencies up to date.<\/td>\n<\/tr>\n<tr>\n<td><strong>Disable Sensitive Endpoints<\/strong><\/td>\n<td>Disable endpoints like&nbsp;<code>env<\/code>&nbsp;and&nbsp;<code>configprops<\/code>&nbsp;in production unless absolutely necessary.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 class=\"wp-block-heading\">4. Opinions from the Community<\/h2>\n<p>The developer community has shared valuable insights on using Spring Boot Actuator effectively. Here are some key opinions:<\/p>\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Custom Endpoints Are Essential<\/strong>: Many developers advocate for creating custom actuator endpoints to monitor application-specific metrics and health checks. This provides deeper insights into the application\u2019s behavior and performance. According to\u00a0<a href=\"https:\/\/www.baeldung.com\/spring-boot-health-indicators\" target=\"_blank\" rel=\"noreferrer noopener\">Baeldung<\/a>, custom health indicators are a great way to extend the default health checks provided by Spring Boot Actuator.<\/li>\n<li><strong>Security Should Be a Priority<\/strong>: The community strongly emphasizes securing actuator endpoints, especially in production environments. Exposing sensitive data without proper authentication can lead to security vulnerabilities. As highlighted in a\u00a0<a href=\"https:\/\/dzone.com\/articles\/securing-spring-boot-actuator-endpoints\" target=\"_blank\" rel=\"noreferrer noopener\">DZone article<\/a>, securing actuator endpoints with Spring Security is a best practice that should not be overlooked.<\/li>\n<li><strong>Minimal Exposure by Default<\/strong>: Some developers recommend exposing only the\u00a0<code>\/health<\/code>\u00a0and\u00a0<code>\/info<\/code>\u00a0endpoints by default. Additional endpoints should be enabled only when necessary to reduce the attack surface. This opinion is supported by the\u00a0<a href=\"https:\/\/docs.spring.io\/spring-boot\/docs\/current\/reference\/html\/actuator.html\" target=\"_blank\" rel=\"noreferrer noopener\">Spring Boot documentation<\/a>, which advises careful management of endpoint exposure.<\/li>\n<li><strong>Integration with Monitoring Tools<\/strong>: Developers often highlight the importance of integrating actuator metrics with tools like Prometheus and Grafana for real-time monitoring and visualization. The\u00a0<a href=\"https:\/\/micrometer.io\/docs\" target=\"_blank\" rel=\"noreferrer noopener\">Micrometer documentation<\/a>\u00a0provides extensive guidance on how to achieve this integration effectively.<\/li>\n<li><strong>Regular Audits and Updates<\/strong>: The community suggests regularly auditing actuator configurations and updating dependencies to ensure the latest security patches and features are applied. This is a recurring theme in discussions on platforms like\u00a0<a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/spring-boot-actuator\" target=\"_blank\" rel=\"noreferrer noopener\">Stack Overflow<\/a>\u00a0and\u00a0<a href=\"https:\/\/www.reddit.com\/r\/springboot\/\" target=\"_blank\" rel=\"noreferrer noopener\">Reddit<\/a>.<\/li>\n<\/ol>\n<p>By incorporating these opinions and best practices, you can ensure that your Spring Boot Actuator implementation is both effective and secure.<\/p>\n<h2 class=\"wp-block-heading\">5. References<\/h2>\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/dzone.com\/articles\/securing-spring-boot-actuator-endpoints\" target=\"_blank\" rel=\"noreferrer noopener\">DZone: Securing Spring Boot Actuator Endpoints<\/a><\/li>\n<li><a href=\"https:\/\/docs.spring.io\/spring-boot\/docs\/current\/reference\/html\/actuator.html\" target=\"_blank\" rel=\"noreferrer noopener\">Spring Boot Actuator Documentation<\/a><\/li>\n<li><a href=\"https:\/\/micrometer.io\/docs\" target=\"_blank\" rel=\"noreferrer noopener\">Micrometer Documentation<\/a><\/li>\n<li><a href=\"https:\/\/docs.spring.io\/spring-security\/reference\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">Spring Security Documentation<\/a><\/li>\n<li><a href=\"https:\/\/www.baeldung.com\/spring-boot-health-indicators\" target=\"_blank\" rel=\"noreferrer noopener\">Baeldung: Custom Health Indicators<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot Actuator is a powerful tool that provides production-ready features to monitor and manage your application. It comes with built-in endpoints for health checks, metrics, environment properties, and more. However, in many cases, you may need to extend these capabilities by creating custom endpoints, securing them, or tailoring them to your application&#8217;s specific needs. &hellip;<\/p>\n","protected":false},"author":1010,"featured_media":121875,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-132031","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Custom Spring Boot Actuator Endpoints - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Learn how to create custom health checks and metrics endpoints in Spring Boot Actuator, secure them with Spring Security, and more!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom Spring Boot Actuator Endpoints - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Learn how to create custom health checks and metrics endpoints in Spring Boot Actuator, secure them with Spring Security, and more!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-10T06:39:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Eleftheria Drosopoulou\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eleftheria Drosopoulou\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html\"},\"author\":{\"name\":\"Eleftheria Drosopoulou\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/5fe56fff01ece0694747967c7217bca4\"},\"headline\":\"Custom Spring Boot Actuator Endpoints\",\"datePublished\":\"2025-03-10T06:39:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html\"},\"wordCount\":809,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/spring-boot-logo.jpg\",\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html\",\"name\":\"Custom Spring Boot Actuator Endpoints - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/spring-boot-logo.jpg\",\"datePublished\":\"2025-03-10T06:39:00+00:00\",\"description\":\"Learn how to create custom health checks and metrics endpoints in Spring Boot Actuator, secure them with Spring Security, and more!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/spring-boot-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2024\\\/04\\\/spring-boot-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2025\\\/03\\\/custom-spring-boot-actuator-endpoints.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Custom Spring Boot Actuator Endpoints\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/5fe56fff01ece0694747967c7217bca4\",\"name\":\"Eleftheria Drosopoulou\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/Eleftheria-Drosopoulou-96x96.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/Eleftheria-Drosopoulou-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/Eleftheria-Drosopoulou-96x96.jpg\",\"caption\":\"Eleftheria Drosopoulou\"},\"description\":\"Eleftheria is an Experienced Business Analyst with a robust background in the computer software industry. Proficient in Computer Software Training, Digital Marketing, HTML Scripting, and Microsoft Office, they bring a wealth of technical skills to the table. Additionally, she has a love for writing articles on various tech subjects, showcasing a talent for translating complex concepts into accessible content.\",\"sameAs\":[\"http:\\\/\\\/www.javacodegeeks.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/eleftheria-drosopoulou\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Custom Spring Boot Actuator Endpoints - Java Code Geeks","description":"Learn how to create custom health checks and metrics endpoints in Spring Boot Actuator, secure them with Spring Security, and more!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html","og_locale":"en_US","og_type":"article","og_title":"Custom Spring Boot Actuator Endpoints - Java Code Geeks","og_description":"Learn how to create custom health checks and metrics endpoints in Spring Boot Actuator, secure them with Spring Security, and more!","og_url":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2025-03-10T06:39:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","type":"image\/jpeg"}],"author":"Eleftheria Drosopoulou","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Eleftheria Drosopoulou","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html"},"author":{"name":"Eleftheria Drosopoulou","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/5fe56fff01ece0694747967c7217bca4"},"headline":"Custom Spring Boot Actuator Endpoints","datePublished":"2025-03-10T06:39:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html"},"wordCount":809,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html","url":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html","name":"Custom Spring Boot Actuator Endpoints - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","datePublished":"2025-03-10T06:39:00+00:00","description":"Learn how to create custom health checks and metrics endpoints in Spring Boot Actuator, secure them with Spring Security, and more!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2024\/04\/spring-boot-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2025\/03\/custom-spring-boot-actuator-endpoints.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Custom Spring Boot Actuator Endpoints"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/5fe56fff01ece0694747967c7217bca4","name":"Eleftheria Drosopoulou","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/03\/Eleftheria-Drosopoulou-96x96.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/03\/Eleftheria-Drosopoulou-96x96.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2015\/03\/Eleftheria-Drosopoulou-96x96.jpg","caption":"Eleftheria Drosopoulou"},"description":"Eleftheria is an Experienced Business Analyst with a robust background in the computer software industry. Proficient in Computer Software Training, Digital Marketing, HTML Scripting, and Microsoft Office, they bring a wealth of technical skills to the table. Additionally, she has a love for writing articles on various tech subjects, showcasing a talent for translating complex concepts into accessible content.","sameAs":["http:\/\/www.javacodegeeks.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/eleftheria-drosopoulou"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/132031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/1010"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=132031"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/132031\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/121875"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=132031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=132031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=132031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}