Is it possible (in any way) to use Spring actuator metrics to Non-Spring apps (for eg Web services in Jersey or RestEasy)?
Any pointers will be helpful.
Thanks!
Related
I have a non boot spring application with micrometer integrated. Right now we are pushing these metrics to the logging file using LoggingRegistry.
We want to enhance this project to expose these metrics in the Rest API(we cannot use actuator as turning ON auto configuration is causing issues in our non boot application).Is there any way to expose these metrics which are automatically provided by the micrometer in the Rest API?
Any example will be appreciated?
You can add PrometheusMeterRegistry, it is for this use case, see the docs: https://micrometer.io/docs/registry/prometheus
We have a spring boot application which exposes REST endpoints. There is a requirement to support SOAP endpoints in the same application.
Can someone help out on the below questions as there is very little to no documentation on this part,
Can spring boot support both REST & SOAP endpoints, on the same port ?
If yes to the above questions, any good documentation or sample project will be really helpful.
Is it advisable to have spring boot application configured in this manner ? If no, what are the cons ?
Spring Boot provides a utility called actuator which gives several useful maintenance endpoints like
/beans , /metrics , /health , /trace , /info, /dump.
This insight is vital for monitoring. By default Spring Actuator functionality is accessible via Spring MVC.
For projects which are not using Spring, like any JAX RS implementation (ours is RESTEASY), Is it possible to somehow integrate these utilities or is there reference implementation that can be referred?
I got below instruction from spring boot doc:
Adding both spring-boot-starter-web and spring-boot-starter-webflux modules in your application results in Spring Boot auto-configuring Spring MVC, not WebFlux. This behavior has been chosen because many Spring developers add spring-boot-starter-webflux to their Spring MVC application to use the reactive WebClient. You can still enforce your choice by setting the chosen application type to SpringApplication.setWebApplicationType(WebApplicationType.REACTIVE)
My question is:
What if my application contains both MVC services and webflux services?
Is it supported?
For example:
I may have some existing admin service which is MVC based. Now I want to add some new services with webflux style.
No, this is not supported. Spring MVC and Spring WebFlux have different runtime models and don't support the same servers (for example, Spring WebFlux can be run with Netty, Spring MVC cannot).
Also, Spring MVC and Spring WebFlux are full web frameworks, meaning each has its own infrastructure that somehow duplicates the other. Deploying both in the same app would make it difficult to map requests (which requests should go where?).
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.