Springboot下跟autuator相关的配置项随记

来自三线的随记
Admin讨论 | 贡献2022年3月28日 (一) 20:43的版本 (创建页面,内容为“properties(yml format) prometheus需要引入依赖 management: endpoints: web: base-path: /metrics exposure: include: '*' health…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

properties(yml format)

prometheus需要引入依赖

management:
  endpoints:
    web:
      base-path: /metrics
      exposure:
        include: '*'
  health:
    db:
      enabled: false
  metrics:
    distribution:
      maximum-expected-value[http.server.requests]: 10000
      minimum-expected-value[http.server.requests]: 1
      percentiles-histogram[http.server.requests]: true
    export:
      jmx:
        enabled: true
      prometheus:
        enabled: true
  security:
    enabled: false

动态修改日志级别

"levels": [
    "OFF",
    "ERROR",
    "WARN",
    "INFO",
    "DEBUG",
    "TRACE"
  ],
curl "http://10.6.100.73:30299/actuator/loggers/ROOT" -s -XPOST -H "Content-Type: application/json" -d '{"configuredLevel":"TRACE","effectiveLevel":"TRACE"}'