spring-prometheus的指标含义

前言

spring-boot作为一个长时间运行的服务,需要也应该能采集到一些指标来反映系统自身的运行状态。下面就spring-boot输出的一些指标分类说明。

依赖

spring-boot开启指标采集需要加入prometheus依赖

指标处理

nametypedata
http_server_requests_secondssummaryhttp_server_requests_seconds_count{exception=“None”,method=“GET”,outcome=“SUCCESS”,status=“200”,uri=“/actuator/prometheus”,} 27.0
http_server_requests_seconds_sum{exception=“None”,method=“GET”,outcome=“SUCCESS”,status=“200”,uri=“/actuator/prometheus”,} 0.588996633
http_server_requests_seconds_maxgaugehttp_server_requests_seconds_max{exception=“None”,method=“GET”,outcome=“SUCCESS”,status=“200”,uri=“/actuator/prometheus”,} 0.0
jvm_buffer_count_buffersgaugejvm_buffer_count_buffers{id=“direct”,} 14.0
jvm_buffer_count_buffers{id=“mapped”,} 0.0
jvm_buffer_memory_used_bytesgaugejvm_buffer_memory_used_bytes{id=“direct”,} 84505.0
jvm_buffer_memory_used_bytes{id=“mapped”,} 0.0
jvm_buffer_total_capacity_bytesgaugejvm_buffer_total_capacity_bytes{id=“direct”,} 84504.0
jvm_buffer_total_capacity_bytes{id=“mapped”,} 0.0
jvm_classes_loaded_classesgaugejvm_classes_loaded_classes 20253.0
jvm_classes_unloaded_classes_totalcounterjvm_classes_unloaded_classes_total 0.0
jvm_gc_live_data_size_bytesgaugejvm_gc_live_data_size_bytes 0.0
jvm_gc_max_data_size_bytesgaugejvm_gc_max_data_size_bytes 0.0
jvm_gc_memory_allocated_bytes_totalcounterjvm_gc_memory_allocated_bytes_total 2.7926361312E10
jvm_gc_memory_promoted_bytes_totalcounterjvm_gc_memory_promoted_bytes_total 9.8676712E7
jvm_gc_pause_secondssummaryjvm_gc_pause_seconds_count{action=“end of minor GC”,cause=“Allocation Failure”,} 29.0
jvm_gc_pause_seconds_sum{action=“end of minor GC”,cause=“Allocation Failure”,} 0.627
jvm_gc_pause_seconds_maxgaugejvm_gc_pause_seconds_max{action=“end of minor GC”,cause=“Allocation Failure”,} 0.0
jvm_memory_committed_bytesgaugejvm_memory_committed_bytes{area=“heap”,id=“PS Survivor Space”,} 2.6738688E7
jvm_memory_committed_bytes{area=“heap”,id=“PS Old Gen”,} 1.073741824E9
jvm_memory_committed_bytes{area=“heap”,id=“PS Eden Space”,} 1.018167296E9
jvm_memory_committed_bytes{area=“nonheap”,id=“Metaspace”,} 1.1665408E8
jvm_memory_committed_bytes{area=“nonheap”,id=“Code Cache”,} 5.4460416E7
jvm_memory_committed_bytes{area=“nonheap”,id=“Compressed Class Space”,} 1.5204352E7
jvm_memory_max_bytesgaugejvm_memory_max_bytes{area=“heap”,id=“PS Survivor Space”,} 2.6738688E7
jvm_memory_max_bytes{area=“heap”,id=“PS Old Gen”,} 1.073741824E9
jvm_memory_max_bytes{area=“heap”,id=“PS Eden Space”,} 1.021837312E9
jvm_memory_max_bytes{area=“nonheap”,id=“Metaspace”,} 5.36870912E8
jvm_memory_max_bytes{area=“nonheap”,id=“Code Cache”,} 2.5165824E8
jvm_memory_max_bytes{area=“nonheap”,id=“Compressed Class Space”,} 1.073741824E9
jvm_memory_used_bytesgaugejvm_memory_used_bytes{area=“heap”,id=“PS Survivor Space”,} 950272.0
jvm_memory_used_bytes{area=“heap”,id=“PS Old Gen”,} 9.8824184E7
jvm_memory_used_bytes{area=“heap”,id=“PS Eden Space”,} 2.52719712E8
jvm_memory_used_bytes{area=“nonheap”,id=“Metaspace”,} 1.1141044E8
jvm_memory_used_bytes{area=“nonheap”,id=“Code Cache”,} 5.4003136E7
jvm_memory_used_bytes{area=“nonheap”,id=“Compressed Class Space”,} 1.4348728E7
jvm_threads_daemon_threadsgaugejvm_threads_daemon_threads 76.0
jvm_threads_live_threadsgaugejvm_threads_live_threads 145.0
jvm_threads_peak_threadsgaugejvm_threads_peak_threads 153.0
jvm_threads_states_threadsgaugejvm_threads_states_threads{state=“runnable”,} 26.0
jvm_threads_states_threads{state=“blocked”,} 0.0
jvm_threads_states_threads{state=“waiting”,} 93.0
jvm_threads_states_threads{state=“timed-waiting”,} 26.0
jvm_threads_states_threads{state=“new”,} 0.0
jvm_threads_states_threads{state=“terminated”,} 0.0
logback_events_totalcounterlogback_events_total{level=“warn”,} 4.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”,} 76.0
process_cpu_usagegaugeprocess_cpu_usage 1.0818998160770312E-4
process_files_max_filesgaugeprocess_files_max_files 1048576.0
process_files_open_filesgaugeprocess_files_open_files 186.0
process_start_time_secondsgaugeprocess_start_time_seconds 1.64880968199E9
process_uptime_secondsgaugeprocess_uptime_seconds 95315.395
rabbitmq_acknowledged_published_totalcounterrabbitmq_acknowledged_published_total{name=“rabbit”,} 0.0
rabbitmq_acknowledged_totalcounterrabbitmq_acknowledged_total{name=“rabbit”,} 126.0
rabbitmq_channelsgaugerabbitmq_channels{name=“rabbit”,} 5.0
rabbitmq_connectionsgaugerabbitmq_connections{name=“rabbit”,} 2.0
rabbitmq_consumed_totalcounterrabbitmq_consumed_total{name=“rabbit”,} 126.0
rabbitmq_failed_to_publish_totalcounterrabbitmq_failed_to_publish_total{name=“rabbit”,} 0.0
rabbitmq_not_acknowledged_published_totalcounterrabbitmq_not_acknowledged_published_total{name=“rabbit”,} 0.0
rabbitmq_published_totalcounterrabbitmq_published_total{name=“rabbit”,} 126.0
rabbitmq_rejected_totalcounterrabbitmq_rejected_total{name=“rabbit”,} 0.0
rabbitmq_unrouted_published_totalcounterrabbitmq_unrouted_published_total{name=“rabbit”,} 0.0
spring_integration_channelsgaugespring_integration_channels 10.0
spring_integration_handlersgaugespring_integration_handlers 10.0
spring_integration_send_secondssummaryspring_integration_send_seconds_count{exception=“none”,name=“unknown”,result=“success”,type=“handler”,} 126.0
spring_integration_send_seconds_sum{exception=“none”,name=“unknown”,result=“success”,type=“handler”,} 4.624411586
spring_integration_send_seconds_count{exception=“none”,name=“_INPUT”,result=“success”,type=“channel”,} 126.0
spring_integration_send_seconds_sum{exception=“none”,name=“_INPUT”,result=“success”,type=“channel”,} 4.628215394
spring_integration_send_seconds_count{exception=“none”,name=“_OUTPUT”,result=“success”,type=“channel”,} 126.0
spring_integration_send_seconds_sum{exception=“none”,name=“_OUTPUT”,result=“success”,type=“channel”,} 0.137322503
spring_integration_send_seconds_maxgaugespring_integration_send_seconds_max{exception=“none”,name=“unknown”,result=“success”,type=“handler”,} 0.0
spring_integration_send_seconds_max{exception=“none”,name=“_INPUT”,result=“success”,type=“channel”,} 0.0
spring_integration_send_seconds_max{exception=“none”,name=“_OUTPUT”,result=“success”,type=“channel”,} 0.0
spring_integration_sourcesgaugespring_integration_sources 0.0
system_cpu_countgaugesystem_cpu_count 24.0
system_cpu_usagegaugesystem_cpu_usage 0.10151826607522811
system_load_average_1mgaugesystem_load_average_1m 3.9
tomcat_global_error_totalcountertomcat_global_error_total{name=“http-nio-8080”,} 0.0
tomcat_global_received_bytes_totalcountertomcat_global_received_bytes_total{name=“http-nio-8080”,} 0.0
tomcat_global_request_max_secondsgaugetomcat_global_request_max_seconds{name=“http-nio-8080”,} 0.482
tomcat_global_request_secondssummarytomcat_global_request_seconds_count{name=“http-nio-8080”,} 27.0
tomcat_global_request_seconds_sum{name=“http-nio-8080”,} 0.81
tomcat_global_sent_bytes_totalcountertomcat_global_sent_bytes_total{name=“http-nio-8080”,} 281704.0
tomcat_sessions_active_current_sessionsgaugetomcat_sessions_active_current_sessions 0.0
tomcat_sessions_active_max_sessionsgaugetomcat_sessions_active_max_sessions 0.0
tomcat_sessions_alive_max_secondsgaugetomcat_sessions_alive_max_seconds 0.0
tomcat_sessions_created_sessions_totalcountertomcat_sessions_created_sessions_total 0.0
tomcat_sessions_expired_sessions_totalcountertomcat_sessions_expired_sessions_total 0.0
tomcat_sessions_rejected_sessions_totalcountertomcat_sessions_rejected_sessions_total 0.0
tomcat_threads_busy_threadsgaugetomcat_threads_busy_threads{name=“http-nio-8080”,} 1.0
tomcat_threads_config_max_threadsgaugetomcat_threads_config_max_threads{name=“http-nio-8080”,} 2000.0
tomcat_threads_current_threadsgaugetomcat_threads_current_threads{name=“http-nio-8080”,} 10.0

指标说明

http请求

  • 每秒http请求数 http_server_requests_seconds
  • http请求数峰值 http_server_requests_seconds_max

jvm

缓冲区

  • 计数缓冲 jvm_buffer_count_buffers
  • 缓冲内存使用大小 jvm_buffer_memory_used_bytes
  • 缓冲容量大小 jvm_buffer_total_capacity_bytes

类信息

  • 已加载类个数 jvm_classes_loaded_classes
  • 已卸载类总数 jvm_classes_unloaded_classes_total

gc信息

  • gc存活数据大小 jvm_gc_live_data_size_bytes
  • gc最大数据大小 jvm_gc_max_data_size_bytes
  • gc分配的内存大小 jvm_gc_memory_allocated_bytes_total
  • gc晋升到下一代的内存大小 jvm_gc_memory_promoted_bytes_total
  • gc等待的时间 jvm_gc_pause_seconds
  • gc等待的最大时间 jvm_gc_pause_seconds_max

内存信息

  • 已提交内存 jvm_memory_committed_bytes
  • 最大内存 jvm_memory_max_bytes
  • 已使用内存 jvm_memory_used_bytes

线程信息

  • 守护线程 jvm_threads_daemon_threads
  • 存活线程 jvm_threads_live_threads
  • 线程峰值 jvm_threads_peak_threads
  • 不同状态的线程 jvm_threads_states_threads

日志

  • 打印日志个数 logback_events_total

进程

  • cpu使用率 process_cpu_usage
  • 最大文件数 process_files_max_files
  • 打开文件数 process_files_open_files
  • 进程启动时刻 process_start_time_seconds
  • 进程运行时间 process_uptime_seconds

rabbitmq

  • 已发布消息数 rabbitmq_published_total
  • 已消费消息数 rabbitmq_consumed_total
  • 已拒绝消息数 rabbitmq_rejected_total
  • 已确认消息数 rabbitmq_acknowledged_total
  • 通道数 rabbitmq_channels
  • 连接数 rabbitmq_connections

integration

  • 通道数 spring_integration_channels
  • 处理器数 spring_integration_handlers
  • 发送消息数 spring_integration_send_seconds
  • 单位时间发送消息最大值 spring_integration_send_seconds_max

系统信息

  • cpu个数 system_cpu_count
  • cpu使用情况 system_cpu_usage
  • 系统平均负载 system_load_average_1m

tomcat信息

全局信息

  • 总体报错数 tomcat_global_error_total
  • 接收的字节总数 tomcat_global_received_bytes_total
  • 发出的字节总数 tomcat_global_sent_bytes_total
  • 每秒最大请求数 tomcat_global_request_max_seconds
  • 每秒请求数 tomcat_global_request_seconds

会话信息

  • 目前活跃会话数 tomcat_sessions_active_current_sessions
  • 活跃最大会话数 tomcat_sessions_active_max_sessions
  • 会话活跃的最长时间 tomcat_sessions_alive_max_seconds
  • 累计创建的会话数 tomcat_sessions_created_sessions_total
  • 累计失效的会话数 tomcat_sessions_expired_sessions_total
  • 累计拒绝的会话数 tomcat_sessions_rejected_sessions_total

线程信息

  • 繁忙的线程数 tomcat_threads_busy_threads
  • 配置的最大线程数 tomcat_threads_config_max_threads
  • 当前线程数 tomcat_threads_current_threads

总结

根据项目的依赖的不同,指标会增加或减少。仔细分析这些指标,还是挺有用处的。了解服务的运行状况有助于排查服务的问题,并做出合理的决策。

  • 1
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值