spring-boot-actuator

How to run spring boot admin client and server in same application

独自空忆成欢 提交于 2021-02-07 08:01:53
问题 I want to run a spring boot admin server and client inside the same application.I changed server port, when I change the server port spring admin will access my changed port. so I can run an admin server. but I can't see my web application pages. i need output like this. Localhost:8080/myapplication (my client application) localhost:8090/admin (spring boot admin server) 回答1: Here is a simple example to run the application on two different ports for admin client and for server client.

springboot application shutsdown automatically on ec2

给你一囗甜甜゛ 提交于 2021-01-28 11:23:11
问题 I deployed my springboot application on ec2 (ubuntu as t2.medium size, AWS AMI as t3.medium size) In my local pc, there is no problem.. but on the ec2, after few hours (during I dont work) It died by itself I just wanted to check what happened when shutdown so I made a below java class as ContextClosedHandler.. but It seems no help for me @Component public class ContextClosedHandler implements ApplicationListener<ContextClosedEvent> { @Override public void onApplicationEvent

Spring boot actuator - Implement custom metrics

核能气质少年 提交于 2021-01-28 05:02:22
问题 I would like to implement custom metric or statistics to my spring boot rest web service using actuator but i am not able to find simple tutorials. For example: how to show how many times a certain controller was called and what exact parameter field was filled? how can i create a metric that when its URL is called, it runs certain query and shows back a json with some result 回答1: This seems like a good scenario for AOP (Aspect Oriented Programing) as this will allow you to separate this

Spring boot 2.1.x how to secure Actuator end points with basic auth

狂风中的少年 提交于 2021-01-28 04:26:45
问题 I am trying to build a spring boot application and wanted to leverage the Actuator features, but I want to secure the end points of Actuator /health,/shutdown etc. I have the below configurations which does not seem to work. I.e., application never prompts for credentials or when hit from post man does not give 403. I tried various ways, even the one from spring documentation. Can any one please help with this. Again this is spring boot 2.1.x. I know there is a configuration that can be made

Spring boot auto configuration with dependency and without @ComponentScan

女生的网名这么多〃 提交于 2021-01-20 20:12:32
问题 Spring boot provides @ComponentScan to find packages to be scanned. I am building a library which has @RestControllers inside with package com.mylib.controller . There are other classes as well with stereotype annotations in different packages. So, if some one is developing SpringBoot Application with com.myapp base package. He uses my library in his application. He need to mention @ComponentScan("com.mylib") to discover stereotype components of library. Is there any way to scan components

Spring boot auto configuration with dependency and without @ComponentScan

十年热恋 提交于 2021-01-20 20:10:34
问题 Spring boot provides @ComponentScan to find packages to be scanned. I am building a library which has @RestControllers inside with package com.mylib.controller . There are other classes as well with stereotype annotations in different packages. So, if some one is developing SpringBoot Application with com.myapp base package. He uses my library in his application. He need to mention @ComponentScan("com.mylib") to discover stereotype components of library. Is there any way to scan components

Elastic Search Health check in spring boot actuator returns status down sometimes

笑着哭i 提交于 2021-01-06 02:40:49
问题 We have a spring-boot (2.0.2) application that does crud operations using transport client with elastic search (6.2.4) with health actuator enabled. We also have a monitoring system that hits the health actuator every 3 mins and alerts if the service is down. This monitoring application alerts 6 to 8 times every day saying there was a timeout exception with ElasticSearch. The alerts are triggered randomly every day without any pattern. I have found these links but were of no use.link1, link2

Elastic Search Health check in spring boot actuator returns status down sometimes

孤街浪徒 提交于 2021-01-06 02:40:42
问题 We have a spring-boot (2.0.2) application that does crud operations using transport client with elastic search (6.2.4) with health actuator enabled. We also have a monitoring system that hits the health actuator every 3 mins and alerts if the service is down. This monitoring application alerts 6 to 8 times every day saying there was a timeout exception with ElasticSearch. The alerts are triggered randomly every day without any pattern. I have found these links but were of no use.link1, link2

Spring Boot Admin high cpu usage / details page refresh interval

筅森魡賤 提交于 2020-12-13 07:27:24
问题 I am in the 'forbidden' scenario of having SBA server and client in one app (so there is only one app registered for any SBA server instance, which is itself). For various reasons I can't change that. I see a huge cpu usage when being on the insights>details page. No clue why, the only thing I can think of is I have a "lot of" caches (like 40). Any guesses on that cpu usage? The second thing is: I am unable to find a config setting how often the graphs on the detail page get updated. Is there