阅读 139

promethues 集成eureka 服务发现

promethues 集成eureka 服务发现

prometheus 从v2.22 开始支持基于eureka的服务发现配置了(内置),对于基于eureka 的spring cloud
微服务解决方案的监控就很方便了,以下是一个简单的试用

环境准备

  • docker-compose 文件

 

version: "3"
services:
  g:
    image: grafana/grafana
    ports:
    - "3000:3000"
  p:
    image: prom/prometheus
    volumes:
    - "./prometheus.yml:/etc/prometheus/prometheus.yml"
    ports:
    - "9090:9090"
  • prometheus.yml 配置

global:
  scrape_interval:     10s
  evaluation_interval: 10s
scrape_configs:
  - job_name: eureka
    metrics_path: /metrics
    eureka_sd_configs:
    - server: <your eureka address>/eureka

启动&&效果

  • 启动

docker-compose up -d
  • 效果

因为我使用本机,访问的是k8s部署的eureka 服务,所有状态是down

 

 

说明

当然一个好消息是VictoriaMetrics 的vmagent 也是支持eureka的服务发现的

参考资料

https://github.com/prometheus/prometheus/blob/release-2.23/documentation/examples/prometheus-eureka.yml
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#eureka_sd_config
https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.48.0

来源https://www.cnblogs.com/rongfengliang/p/14087094.html#4874322

文章分类
后端
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐