How to customize Spring Boot Actuator endpoints - spring-boot

I'm trying to implement Spring Boot Actuator on a non "Boot Application", is there a way to configure a pattern to endpoints like endpoint/health,endpoint/metrics? Then I'll create a second realm in my existing Spring Security configuration, I tried the documentation but I could not find a thing about.
Thanks.

Did you mean management.contextPath=/endpoint (docs here)?

Related

Implement Spring Cloud Sleuth's TracingWebFillter in Spring WebFlux

I have a Spring Boot Reactive application using Functional Endpoints ( Kotlin) that uses Spring Cloud Sleuth. I want to customize the response headers to include the trace id. I looked at the manual and saw the section on using the TraceFilter : 1
I tried to do the same using a TraceWebFilter, but it doesn't expose the constructors. Is there a way to implement this customization when using the Reactive Web Framework.
I am using version 2.0.0.M5 for Spring Cloud Sleuth
Thanks in advance!
Please check out the latest master - we've migrated to Brave. You can write your WebFilter that will delegate to TraceWebFilter. Or you can just copy our TraceWebFilter and alter it in the way you need to.

Can I use "Spring Webflow" without "Spring Security"?

I need to add a workflow engine on my web application.
I use Form-Based Authentication for my login.
I tried to use Spring Webflow, but as I was searching, I realised that every link I have found, refers also to Spring Security.
Therefor, I would like to know, if I can use Spring Webflow without Spring Security.
Does Spring Webflow work without Spring Security or not?
In case you know the answer, please leave a comment below.
Thank you in advance.

Accessing localhost:8080/actuator endpoint (with spring boot actuator)

In spring docs I have read about endpoint named "actuator" which is provided by actuator dependency, but I haven't managed to access it on my local testing app.
Question: Does someone know how to access that endpoint? of coarse if it is possible :)
Sub-question 1: If this endpoint exists, then why it is hidden?
Sub-question 2: If this endpoint doesn't exist, how can we notify spring.io to correct documentation page (open some kind of ticket) ?
Details:
I want to access exactly "actuator" endpoint, not other endpoints provided by spring boot actuator (localhost:8080/actuator)
Yes, I have tried to enable that endpoint manually in properties file (endpoints.enabled=true OR endpoints.actuator.enabled=true)
Yes, I have tried to enable/disable endpoints.sencitive property
Yes, other endpoints of actuator work just fine
No special reason why I need that, just want to try it out (just learning new stuff :) )
Please don't just answer "there is no such endpoint dude!", there should be some kind of reason why it is written in the docs
Please use spring boot version which I am using now before answering "it is working for me with these configs" (spring boot version: 1.5.4.RELEASE)
Thank you in advance :)
You must include the Spring Hateoas dependency in order for the /actuator endpoint to become available:
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>
Per the docs:
Provides a hypermedia-based “discovery page” for the other endpoints.
Requires Spring HATEOAS to be on the classpath.

Consuming Spring cloud config using Spring REST service (non-boot rest service)

I'm just curious, is it possible to consume Spring Cloud config by a Spring REST service which is not a Spring boot application. If it is possible, where to define the properties in a Spring REST service. I meant, where should I define
spring.cloud.config.uri etc.
Or, only Spring boot applications are allowed to consume Cloud configuration?
Any thought would be appreciated. Thanks
well spring boot just bootstrap all configuration automatically . so for simple spring application you have to config it manually and define the cloud config server beans in your application configuration file . it could be pure old fashion xml files or just using java code configuration with #Configuration. you could find some samples in github

Spring Boot Actuator in the traditional container

Can we use the Spring Boot Actuator in the traditional shared container within the context of an application? If so, how would be the configuration look like?
I have tried it by bootstrapping EndpointWebMvcAutoConfiguration. However, could not map mvc urls.
There's nothing stopping you from just using it as a dependency. Any Spring Boot app should be able to use actuator features out of the box.

Resources