spring-boot-actuator

Spring Boot 2 Actuator endpoints inaccessible with Jersey

南笙酒味 提交于 2019-12-10 18:21:29
问题 I have a very simple demo application using the Spring Boot 2.0.x.RELEASE In my POM I have: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <spring-cloud

Micrometer - Prometheus Gauge displays NaN

本小妞迷上赌 提交于 2019-12-09 18:36:19
问题 I am trying to generate Prometheus metrics with using Micrometer.io with Spring Boot 2.0.0.RELEASE. When I am trying to expose the size of a List as Gauge, it keeps displaying NaN. In the documentation it says that; It is your responsibility to hold a strong reference to the state object that you are measuring with a Gauge. I have tried some different ways but I could not solve the problem. Here is my code with some trials. import io.micrometer.core.instrument.*; import io.swagger.backend

WhyI am Getting 403 Forbidden error for actuator /refresh endpoint on Spring Boot 2 on Cloud Foundry{using Cloud Config Server service}

≯℡__Kan透↙ 提交于 2019-12-09 18:31:28
问题 Within my project, I have the following bootstrap.properties file: spring.application.name=vault-demo management.endpoints.web.exposure.include=* Additionally to that, I defined the following dependency: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-actuator</artifactId> </dependency> The config server is able to access the property but when I update that property in GitHub and POST to /refresh I get a 403: Forbidden . Do I need to make any change in my

Unit testing of Spring Boot Actuator endpoints not working when specifying a port

橙三吉。 提交于 2019-12-09 16:20:10
问题 recently I changed my spring boot properties to define a management port. In doing so, my unit tests started to fail :( I wrote a unit test that tested the /metrics endpoint as follows: @RunWith (SpringRunner.class) @DirtiesContext @SpringBootTest public class MetricsTest { @Autowired private WebApplicationContext context; private MockMvc mvc; /** * Called before each test. */ @Before public void setUp() { this.context.getBean(MetricsEndpoint.class).setEnabled(true); this.mvc =

Spring Boot Actuator /health endpoint does not show database or file system information

梦想与她 提交于 2019-12-09 14:31:34
问题 I cannot get database information or filesystem information to show up on the /health endpoint. I only can get: { "status": "UP" } Details about my setup and configuration: - Spring Boot 1.3.3 - Running the WAR on JBoss EAP 6.4 - Datasource is a JNDI resource. - Oracle is the database spring: datasource: # Must match the datasource name in JBoss standalone.xml jndi-name: java:jboss/beautiful-ds driver-class-name: oracle.jdbc.driver.OracleDriver jpa: properties: # escapes reserved words used

Spring Boot Admin Page

那年仲夏 提交于 2019-12-09 07:06:55
问题 I am trying to understand how to use SBAP in my application because it is a very handy tool for development. I'm reading their reference guide but I'm not understanding a few things. Here is my pom for my application right now: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging>

Spring Boot Management Port and Spring Security

雨燕双飞 提交于 2019-12-08 10:15:46
问题 I have a spring boot web application with security configurations to forward all unauthorized requests to /login. I set up a spring boot management port different from my application port . When I go to the management port and try to access /health, it tries to send me to /login on that port and I get this response: ''' {"timestamp":1435680239995,"status":404,"error":"Not Found","message":"No message available","path":"/login"} ''' I found this question but I couldn't make it work in my

How to get oAuth2 access token when user call signup rest API in springboot?

痴心易碎 提交于 2019-12-08 01:40:54
问题 currently I am working on Springboot security, its quite new for me. I followed youtube video tutorial Video I am getting oauth2 access_token successfully when I use bellow code snippet:- @SpringBootApplication public class MathifyApplication { @Autowired private PasswordEncoder passwordEncoder; public static void main(String[] args) { SpringApplication.run(MathifyApplication.class, args); } @Autowired public void authenticationManager(AuthenticationManagerBuilder builder, UserRepository

Swagger2 > Document a SpringBoot MvcEndpoint

送分小仙女□ 提交于 2019-12-07 18:10:04
问题 I'm currently in the process of trying out Swagger2 on my SpringBoot project (it works great), however, it only picks up my @RestController classes. I was wondering: Can it be used to pick up a Spring-Actuator MvcEndpoint? Can the Swagger2 components (e.g. /swagger-ui.html , /v2/api-docs ) be hosted under the management port (e.g. http://${management.address}:${management.port}), instead of server.port ? Application.java @EnableSwagger2 @SpringBootApplication public class Application { @Bean

Spring Boot Actuator/Micrometer Metrics Disable Some

半腔热情 提交于 2019-12-07 13:48:10
问题 Is there a way to turn off some of the returned metric values in Actuator/Micrometer? Looking at them now I'm seeing around 1000 and would like to whittle them down to a select few say 100 to actually be sent to our registry. 回答1: Meter filters can help in 3 ways that have been discussed with the Micrometer slack channel: Disabling metrics Combining dimensions High cardinality capping filter Micrometer comes with the first type of meter filter built in. It also support hierarchical enabling