spring-boot-actuator
2019-01-22 18:07:47 39 举报
AI智能生成
spring-boot-actuator功能梳理笔记
作者其他创作
大纲/内容
Metric writers, exporters and aggregation
commons
Propertis
spring.metrics.export.enabled=false
禁用
spring.metrics.export.delay-millis
spring.metrics.export.includes
spring.metrics.export.excludes
spring.metrics.export.send-latest
Beans
MetricExportProperties
MetricExportAutoConfiguration
MetricWriter
MetricRepository
InMemoryMetricRepository
MetricReader
AggregateMetricReader
PublicMetrics
Annotations
@ExportMetricWriter
@ExportMetricReader
Export to Redis
Beans
MetricWriter
RedisMetricRepository
Properties
spring.metrics.export.redis.prefix
spring.metrics.export.redis.key
Export to Open TSDB
Beans
OpenTsdbGaugeWriter
Properties
?
Export to Statsd
Dependencies
com.timgroup:java-statsd-client
Beans
MetricWriter
StatsdMetricWriter
Properties
spring.metrics.export.statsd.host
spring.metrics.export.statsd.port=8125
spring.metrics.export.statsd.prefix
Export to JMX
Beans
MetricWriter
StatsdMetricWriter
Loggers
Configure a Logger
Auditing
listener
AbstractAuthenticationAuditListener
AbstractAuthorizationAuditListener
AuditEventRepository
AuditApplicationEvent
ApplicationEventPublisher
ApplicationEventPublisherAware
Actuator Security
Configuration
Dependencies
org.springframework.boot:spring-boot-actuator
Properties
management
management.port=
management.security.enabled=false
endpoints
endpoints.health.sensitive=false
logback-spring.xml
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>
展示
spring-boot-admin
References
https://docs.spring.io/spring-boot/docs/1.5.13.RELEASE/reference/htmlsingle/
Endpoints
commons
actuator
auditevents
autoconfig
beans
configprops
dump
env
flyway
health
status
management.health.status.order=DOWN, OUT_OF_SERVICE, UNKNOWN, UP
endpoints.health.mapping.UP=200
HealthIndicators
DiskSpaceHealthIndicator
DataSourceHealthIndicator
RabbitHealthIndicator
RedisHealthIndicator
MailHealthIndicator
...
info
InfoContributors
EnvironmentInfoContributor
properties: info.*
GitInfoContributor
class:/git.properties
BuildInfoContributor
class:/META-INF/build-info.properties
Properties
management.info.defaults.enabled=true
management.info.git.mode=full
loggers
liquibase
mappings
shutdown
trace
metrics
counter
counter.servo
custom metrics
CounterService
increment
decrement
reset
DropwizardMetricServices
gauge
gauge.servo
custom metrics
GaugeService
submit
DropwizardMetricServices
normalized
normalized.servo
System metrics
mem
instance
heap
nonheap
processors
systemload
threads
uptime
classes
gc
gc.ps_scavenge
gc.ps_marksweep
Datasource metrics
datasource
Cache metrics
Tomcat session metrics
httpsessions
springmvc
docs
heapdump
jolokia
logfile
Features
Customizing endpoints
endpoints.{name}.*
endpoints.enabled=
endpoints.{name}.enabled=
endpoints.sensitive=
endpoints.{name}.sensitive=
Hypermedia for actuator MVC endpoints
Dependencies
spring-boot-starter-hateoas
Properties
endpoints.hypermedia.enabled=true
endpoints.actuator.path
CORS support
endpoints.cors.allowed-origins=http://example.com
endpoints.cors.allowed-methods=GET,POST
Adding custom endpoints
Beans
Endpoint
MvcEndpoint
MetricsEndpoint
Annotations
@ManagementContextConfiguration
Monitoring and management over HTTP
Accessing sensitive endpoints
management.security.roles=ATUATOR
management.security.enabled=false
Customizing the management endpoint paths
management.context-path=/manage
Customizing the management server port
management.port=${server.port}
management.port=8081
Configuring management-specific SSL
Customizing the management server address
management.address=127.0.0.1
Disabling HTTP endpoints
management.port=-1
HTTP health endpoint format and access restrictions
endpoints.health.time-to-live=1000
默认缓存1s
management.security.enabled
endpoints.health.sensitive
Monitoring and management over JMX
Customizing MBean names
endpoints.jmx.domain=myapp
endpoints.jmx.unique-names=true
Disabling JMX endpoints
endpoints.jmx.enabled=false
Using Jolokia for JMX over HTTP
dependency
org.jolokia:jolokia-core
Customizing Jolokia
jolokia.config.debug=true
Disabling Jolokia
endpoints.jolokia.enabled=false
0 条评论
下一页