44-Spring-Boot-Actuator Flashcards
What is the default actuator endpoint? How to change it?
/actuator
management.endpoints.web.base-path=/admin
How to get the list of supported metrics?
/actuator/metrics returns {names: […]}
Configuration to expose metrics via HTTP?
management.endpoints.web.exposure.include=metrics
URL to view details of a metric?
/actuator/metrics/metric-name
List out 10 actuator endpoints
health info metrics liquibase flyway auditevents beans caches conditions env loggers mappings sessions threaddump shutdown
What endpoints are enabled and exposed via HTTP?
HTTP: all enabled except shutdown, httptrace, and auditevents. Expose only heath and info
How to enabled endpoints via JMX?
spring.jmx.enabled=true
By default, what endpoints are disabled via HTTP?
shutdown, httptrace and auditevents
What endpoints are enabled and exposed via JMX?
JMX: disabled by default, all enabled are exposed
How to expose all endpoints via HTTP?
management.endpoints.web.exposure.include=*
Note: endpoints with s
2 ways to secure endpoints via Spring Security?
With Spring security: http.authorizeRequests() .mvcMatcher("/actuator/**").hasRole("ACTUATOR") .anyRequest().authenticated(); OR: http.authorizeRequests() .requestMatchers(EndpointRequest.toAnyEndpoint()).hasRole("ACTUATOR) .anyRequest().authenticated();
List out custom metric classes
Counter
Gauge
Timer
DistributionSummary
How to register a metric?
Inject and use MeterRegistry
What is the naming convention of hierarchical HTTP metrics?
http.method.$methodName.status.$statusName
How to get the value of a tagged HTTP metric by status and method?
http?tag=method:get&tag=status:200