springboot actuator

Posted 清浊

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了springboot actuator相关的知识,希望对你有一定的参考价值。

1、什么是actuator

线上监控工具

2、如何整合

遵循三板斧

第一步加依赖

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

第二步加注解

第三步加配置

启动后访问项目路径加上/actuator

 

 

 /actuator/health,作用健康检查。

在配置中加入

management.endpoint.health.show-details=always

可以检查如下这么多资源的健康状态

53.8.1 Auto-configured HealthIndicators

CassandraHealthIndicator

Checks that a Cassandra database is up.

CouchbaseHealthIndicator

Checks that a Couchbase cluster is up.

DiskSpaceHealthIndicator

Checks for low disk space.

DataSourceHealthIndicator

Checks that a connection to DataSource can be obtained.

ElasticsearchHealthIndicator

Checks that an Elasticsearch cluster is up.

InfluxDbHealthIndicator

Checks that an InfluxDB server is up.

JmsHealthIndicator

Checks that a JMS broker is up.

MailHealthIndicator

Checks that a mail server is up.

MongoHealthIndicator

Checks that a Mongo database is up.

Neo4jHealthIndicator

Checks that a Neo4j server is up.

RabbitHealthIndicator

Checks that a Rabbit server is up.

RedisHealthIndicator

Checks that a Redis server is up.

SolrHealthIndicator

Checks that a Solr server is up.

info端口主要是用来描叙应用信息的

info.app-name = pay
info.author = xiaofeiyang
info.email = 469821953@qq.com

actuator暴露的所有端点见

53.2 Exposing Endpoints

auditevents

Yes

No

beans

Yes

No

caches

Yes

No

conditions

Yes

No

configprops

Yes

No

env

Yes

No

flyway

Yes

No

health

Yes

Yes

heapdump

N/A

No

httptrace

Yes

No

info

Yes

Yes

integrationgraph

Yes

No

jolokia

N/A

No

logfile

N/A

No

loggers

Yes

No

liquibase

Yes

No

metrics

Yes

No

mappings

Yes

No

prometheus

N/A

No

scheduledtasks

Yes

No

sessions

Yes

No

shutdown

Yes

No

threaddump

Yes

No

以上是关于springboot actuator的主要内容,如果未能解决你的问题,请参考以下文章

springboot04_springboot特性之Actuator

#yyds干货盘点# springboot整合Actuator监控

springboot源码研究actuator,自定义actuator路径

[转]springboot 监控 Actuator和Admin

SpringBoot系列:SpringBoot使用Actuator

SpringBoot系列: Actuator监控