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

来自三线的随记

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"}'