当前位置:网站首页>Is error log monitoring enough? Don't try JVM monitoring of microservices
Is error log monitoring enough? Don't try JVM monitoring of microservices
2022-07-29 10:22:00 【xdd】
Now many companies are using microservices , Some companies are also landing DDD In the business , So has your service been monitored ? Generally, in addition to the monitoring of error logs , Alarm and email 、 Fly Book messages or text messages , Others monitor the database or server , So what do you think of your service JVM Has the level been monitored ?
If not JVM Monitoring of , Then look at the following , I'll tell you one SpringBoot How to do micro Services JVM Level of monitoring ?
SpringBoot application JVM Monitoring practice DEMO
One 、 Increase dependency in services
Two 、 increase Springboot Actuator and promethus To configure
To increase the Springboot Actuator The configuration of is as follows
To increase the prometheus The configuration is as follows :
start-up Springboot After the application , Use as follows URL The following responses can be observed :
request :
http://ip:port/actuator/prometheusRespond to :
# HELP jvm_gc_memory_promoted_bytes_total Count of positive increases in the size of the old generation memory pool before GC to after GC
# TYPE jvm_gc_memory_promoted_bytes_total counter
jvm_gc_memory_promoted_bytes_total 3.74492E7
# HELP jvm_buffer_count_buffers An estimate of the number of buffers in the pool
# TYPE jvm_buffer_count_buffers gauge
jvm_buffer_count_buffers{id="direct",} 5.0
jvm_buffer_count_buffers{id="mapped",} 0.0
# HELP jvm_gc_live_data_size_bytes Size of old generation memory pool after a full GC
# TYPE jvm_gc_live_data_size_bytes gauge
jvm_gc_live_data_size_bytes 5.3624472E7
# HELP jvm_threads_states_threads The current number of threads having NEW state
# TYPE jvm_threads_states_threads gauge
jvm_threads_states_threads{state="runnable",} 49.0
jvm_threads_states_threads{state="blocked",} 0.0
jvm_threads_states_threads{state="waiting",} 44.0
jvm_threads_states_threads{state="timed-waiting",} 35.0
jvm_threads_states_threads{state="new",} 0.0
jvm_threads_states_threads{state="terminated",} 0.0
# HELP spring_integration_channels The number of message channels
# TYPE spring_integration_channels gauge
spring_integration_channels 2.0
# HELP jvm_memory_max_bytes The maximum amount of memory in bytes that can be used for memory management
# TYPE jvm_memory_max_bytes gauge
jvm_memory_max_bytes{area="heap",id="PS Survivor Space",} 3.145728E7
jvm_memory_max_bytes{area="heap",id="PS Old Gen",} 2.845310976E9
jvm_memory_max_bytes{area="heap",id="PS Eden Space",} 1.354235904E9
jvm_memory_max_bytes{area="nonheap",id="Metaspace",} -1.0
jvm_memory_max_bytes{area="nonheap",id="Code Cache",} 2.5165824E8
jvm_memory_max_bytes{area="nonheap",id="Compressed Class Space",} 1.073741824E9
# HELP jvm_memory_committed_bytes The amount of memory in bytes that is committed for the Java virtual machine to use
# TYPE jvm_memory_committed_bytes gauge
jvm_memory_committed_bytes{area="heap",id="PS Survivor Space",} 3.145728E7
jvm_memory_committed_bytes{area="heap",id="PS Old Gen",} 2.63192576E8
jvm_memory_committed_bytes{area="heap",id="PS Eden Space",} 3.55991552E8
jvm_memory_committed_bytes{area="nonheap",id="Metaspace",} 8.5458944E7
jvm_memory_committed_bytes{area="nonheap",id="Code Cache",} 1.769472E7
jvm_memory_committed_bytes{area="nonheap",id="Compressed Class Space",} 1.1010048E7
# HELP tomcat_sessions_active_current_sessions
# TYPE tomcat_sessions_active_current_sessions gauge
tomcat_sessions_active_current_sessions 0.0
# HELP logback_events_total Number of error level events that made it to the logs
# TYPE logback_events_total counter
logback_events_total{level="warn",} 12.0
logback_events_total{level="debug",} 0.0
logback_events_total{level="error",} 0.0
logback_events_total{level="trace",} 0.0
logback_events_total{level="info",} 56.0
# HELP tomcat_sessions_expired_sessions_total
# TYPE tomcat_sessions_expired_sessions_total counter
tomcat_sessions_expired_sessions_total 0.0
# HELP tomcat_sessions_alive_max_seconds
# TYPE tomcat_sessions_alive_max_seconds gauge
tomcat_sessions_alive_max_seconds 0.0
# HELP jvm_gc_memory_allocated_bytes_total Incremented for an increase in the size of the young generation memory pool after one GC to before the next
# TYPE jvm_gc_memory_allocated_bytes_total counter
jvm_gc_memory_allocated_bytes_total 1.447756672E9
# HELP process_start_time_seconds Start time of the process since unix epoch.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.633764054233E9
# HELP jvm_memory_used_bytes The amount of used memory
# TYPE jvm_memory_used_bytes gauge
jvm_memory_used_bytes{area="heap",id="PS Survivor Space",} 3.143352E7
jvm_memory_used_bytes{area="heap",id="PS Old Gen",} 5.6170736E7
jvm_memory_used_bytes{area="heap",id="PS Eden Space",} 1.45013368E8
jvm_memory_used_bytes{area="nonheap",id="Metaspace",} 8.1185736E7
jvm_memory_used_bytes{area="nonheap",id="Code Cache",} 1.7651712E7
jvm_memory_used_bytes{area="nonheap",id="Compressed Class Space",} 1.0256224E7
# HELP system_cpu_count The number of processors available to the Java virtual machine
# TYPE system_cpu_count gauge
system_cpu_count 8.0
# HELP jvm_classes_loaded_classes The number of classes that are currently loaded in the Java virtual machine
# TYPE jvm_classes_loaded_classes gauge
jvm_classes_loaded_classes 15057.0
# HELP jvm_buffer_total_capacity_bytes An estimate of the total capacity of the buffers in this pool
# TYPE jvm_buffer_total_capacity_bytes gauge
jvm_buffer_total_capacity_bytes{id="direct",} 16400.0
jvm_buffer_total_capacity_bytes{id="mapped",} 0.0
# HELP spring_integration_sources The number of message sources
# TYPE spring_integration_sources gauge
spring_integration_sources 0.0
# HELP jvm_threads_daemon_threads The current number of live daemon threads
# TYPE jvm_threads_daemon_threads gauge
jvm_threads_daemon_threads 69.0
# HELP tomcat_sessions_created_sessions_total
# TYPE tomcat_sessions_created_sessions_total counter
tomcat_sessions_created_sessions_total 0.0
# HELP tomcat_sessions_rejected_sessions_total
# TYPE tomcat_sessions_rejected_sessions_total counter
tomcat_sessions_rejected_sessions_total 0.0
# HELP jvm_gc_max_data_size_bytes Max size of old generation memory pool
# TYPE jvm_gc_max_data_size_bytes gauge
jvm_gc_max_data_size_bytes 2.845310976E9
# HELP process_cpu_usage The "recent cpu usage" for the Java Virtual Machine process
# TYPE process_cpu_usage gauge
process_cpu_usage 0.12716195672342906
# HELP jvm_buffer_memory_used_bytes An estimate of the memory that the Java virtual machine is using for this buffer pool
# TYPE jvm_buffer_memory_used_bytes gauge
jvm_buffer_memory_used_bytes{id="direct",} 16402.0
jvm_buffer_memory_used_bytes{id="mapped",} 0.0
# HELP tomcat_sessions_active_max_sessions
# TYPE tomcat_sessions_active_max_sessions gauge
tomcat_sessions_active_max_sessions 0.0
# HELP jvm_threads_live_threads The current number of live threads including both daemon and non-daemon threads
# TYPE jvm_threads_live_threads gauge
jvm_threads_live_threads 128.0
# HELP jvm_threads_peak_threads The peak live thread count since the Java virtual machine started or peak was reset
# TYPE jvm_threads_peak_threads gauge
jvm_threads_peak_threads 128.0
# HELP jvm_classes_unloaded_classes_total The total number of classes unloaded since the Java virtual machine has started execution
# TYPE jvm_classes_unloaded_classes_total counter
jvm_classes_unloaded_classes_total 0.0
# HELP system_cpu_usage The "recent cpu usage" for the whole system
# TYPE system_cpu_usage gauge
system_cpu_usage 0.08727740040389209
# HELP spring_integration_handlers The number of message handlers
# TYPE spring_integration_handlers gauge
spring_integration_handlers 1.0
# HELP process_uptime_seconds The uptime of the Java virtual machine
# TYPE process_uptime_seconds gauge
process_uptime_seconds 252.707
# HELP jvm_gc_pause_seconds Time spent in GC pause
# TYPE jvm_gc_pause_seconds summary
jvm_gc_pause_seconds_count{action="end of major GC",cause="Metadata GC Threshold",} 1.0
jvm_gc_pause_seconds_sum{action="end of major GC",cause="Metadata GC Threshold",} 0.24
jvm_gc_pause_seconds_count{action="end of minor GC",cause="Metadata GC Threshold",} 1.0
jvm_gc_pause_seconds_sum{action="end of minor GC",cause="Metadata GC Threshold",} 0.02
jvm_gc_pause_seconds_count{action="end of minor GC",cause="Allocation Failure",} 3.0
jvm_gc_pause_seconds_sum{action="end of minor GC",cause="Allocation Failure",} 0.047
jvm_gc_pause_seconds_count{action="end of minor GC",cause="GCLocker Initiated GC",} 1.0
jvm_gc_pause_seconds_sum{action="end of minor GC",cause="GCLocker Initiated GC",} 0.018
# HELP jvm_gc_pause_seconds_max Time spent in GC pause
# TYPE jvm_gc_pause_seconds_max gauge
jvm_gc_pause_seconds_max{action="end of major GC",cause="Metadata GC Threshold",} 0.0
jvm_gc_pause_seconds_max{action="end of minor GC",cause="Metadata GC Threshold",} 0.0
jvm_gc_pause_seconds_max{action="end of minor GC",cause="Allocation Failure",} 0.0
jvm_gc_pause_seconds_max{action="end of minor GC",cause="GCLocker Initiated GC",} 0.0The final effect is shown in the figure below
3、 ... and 、 Problems encountered in practice
( One ) problem 1
You can see the following problem through the screenshot :
Above class TextFormat Medium Collector.Type.INFO Medium to low version simpleclient 0.5.0 There is no cause for this exception .
The reason for this : because spring-cloud-starter-alibaba-nacos-discovery It depends on 0.5.0 Version of simpleclient
Solution : Get rid of spring-cloud-starter-alibaba-nacos-discovery Low version in simpleclient that will do
边栏推荐
- [ts]typescript learning record pit collection
- Is there any charge for PDF processing? impossible
- Shell notes (super complete)
- 二次握手??三次挥手??
- Solve problems intelligently
- 跟着武老师学高数——函数、极限和连续(持续更新)
- 函数——(C游记)
- Intel joins hands with datawhale to launch learning projects!
- Orbslam2 installation test and summary of various problems
- [HFCTF 2021 Final]easyflask
猜你喜欢

The latest translated official pytorch easy introduction tutorial (pytorch version 1.0)

Attachment of text of chenjie Report
![[Yugong series] go teaching course 009 in July 2022 - floating point type of data type](/img/85/3c776af519debbb2df802ea774c965.png)
[Yugong series] go teaching course 009 in July 2022 - floating point type of data type
![[jetson][reprint]pycharm installed on Jetson](/img/65/ba7f1e7bd1b39cd67018e3f17d465b.png)
[jetson][reprint]pycharm installed on Jetson

Implementation of college logistics repair application system based on SSM

不堆概念、换个角度聊多线程并发编程

MySQL优化理论学习指南
![[dark horse morning post] Youxian responded to the dissolution every day, and many places have been unable to place orders; Li Bin said that Wei Lai will produce a mobile phone every year; Li Ka Shing](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[dark horse morning post] Youxian responded to the dissolution every day, and many places have been unable to place orders; Li Bin said that Wei Lai will produce a mobile phone every year; Li Ka Shing

Turn the evolutionary path of push

Follow teacher Tian to learn practical English Grammar (continuous update)
随机推荐
After E-sports enters Asia, will Tencent be the next "NBA game catcher"?
Encyclopedia of introduction to machine learning - 2018 "machine learning beginners" official account article summary
一文读懂Plato Farm的ePLATO,以及其高溢价缘由
[FPGA tutorial case 18] develop low delay open root calculation through ROM
Uniswap entered the NFT trading market and opensea took the lead
PDF处理还收费?不可能
A Zuo's realm
[HFCTF 2021 Final]easyflask
这才是开发者神器正确的打开方式
跟着武老师学高数——函数、极限和连续(持续更新)
Is it safe to open an account online now? Do you want to know that you must go to the business hall to open an account now?
Functions and arrays
MySQL infrastructure: SQL query statement execution process
The function of that sentence
待人宽容大度
英特尔联合Datawhale,发布学习项目!
The maximum length of VARCHAR2 type in Oracle is_ Oracle modify field length SQL
Comprehensively design an oppe home page -- the bottom of the page
Several common design methods of test cases [easy to understand]
不堆概念、换个角度聊多线程并发编程