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报警)
目录
文章列表
1 Nginx配置SSL采坑总结
Nginx配置SSL采坑总结
2
Android如何区分debug和release两种状态
Android如何区分debug和release两种状态
3
Android热修复主流方案
Android热修复主流方案
4
Lucene的学习第三篇 — 分词
Lucene的学习第三篇 — 分词
5
ElasticSearch High Level REST API(2)搜索查询
ElasticSearch High Level REST API(2)搜索查询
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。