Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

Prometheus + Grafana 监控 Spring Cloud 应用

应用依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Micrometer Prometheus registry -->
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

应用配置

#metrics
management:
  metrics:
    export:
      prometheus:
        enabled: true
  endpoints:
    web:
      exposure:
        include: health, info, httptrace, metrics, threaddump, mappings, prometheus
  endpoint:
    health:
      show-details: always

Prometheus配置

- job_name: 'spring_cloud_application'
  metrics_path: '/actuator/prometheus'
  static_configs:
    - targets: ['192.168.16.8:8801']
      labels:
        application: appblog
        instance: service-a
        group: inner
    - targets: ['192.168.16.8:8802']
      labels:
        application: appblog
        instance: service-b
        group: inner
    - targets: ['192.168.16.8:8803']
      labels:
        application: appblog
        instance: service-c
        group: inner
    - targets: ['192.168.16.10:8804']
      labels:
        application: appblog
        instance: service-d
        group: inner
    - targets: ['192.168.16.10:8805']
      labels:
        application: appblog
        instance: service-e
        group: inner
上一篇 Prometheus与Zabbix的对比
下一篇 Prometheus + Alertmanager 报警实现(email报警)