Prometheus 基于文件的服务发现
Prometheus 基于文件的服务发现
官方文档:https://github.com/prometheus/prometheus/tree/master/discovery
服务发现支持: endpoints,ingress,kubernetes,node,pod,service。
Prometheus也提供了服务发现功能,可以从consul,dns,kubernetes,file等等多种来源发现新的目标。
其中最简单的是从文件发现服务。
• azure_sd_configs
• consul_sd_configs
• dns_sd_configs
• ec2_sd_configs
• openstack_sd_configs
• file_sd_configs
• gce_sd_configs
• kubernetes_sd_configs
• marathon_sd_configs
• nerve_sd_configs
• serverset_sd_configs
• triton_sd_configs
Prometheus 支持服务发现的来源:
1、编写配置文件:vim prometheus.yml
scrape_configs:
- job_name: 'prometheus'
# 使用基于文件服务发现
file_sd_configs:
# 指定服务发现的目录及配置文件
- files: ['/usr/local/prometheus/sd_config/*.yml']
# 每过5秒动态发现服务配置
refresh_interval: 5s
2、创建目录
mkdir /usr/local/prometheus/sd_config
3、写入配置文件
vim /usr/local/prometheus/sd_config/test.yml
# 添加本地主机并填入标签
- targets: ['localhost:9090']
labels:
idc: bj

Prometheus 基于文件的服务发现的更多相关文章
- Prometheus基于文件的服务发现
Prometheus基于文件的服务发现 一.基于文件的服务发现 1.prometheus.yml 配置文件的写法 2.file_sd 目录下的文件 3.配置结果 二.注意事项 三.参考链接 一.基于文 ...
- prometheus — 基于文件的服务发现
基于文件的服务发现方式不需要依赖其他平台与第三方服务,用户只需将要新的target信息以yaml或json文件格式添加到target文件中 ,prometheus会定期从指定文件中读取target信息 ...
- Prometheus基于Eureka的服务发现
Prometheus基于Eureka的服务发现 一.背景 二.实现步骤 1.eureka 客户端注册到prometheus中 2.prometheus中的写法 3.实现效果 三.完整代码 四.参考链接 ...
- prometheus 基于文件的目标发现
prometheus 基于文件的目标发现 1.创建目录 cd /usr/local/prometheus/conf mkdir -pv targets/{nodes,docker} 2.修改prome ...
- prometheus 基于DNS的目标发现
prometheus 基于DNS的目标发现 DNS服务发现依赖于查询A.AAAA或SRV DNS记录. 1.基于 SRV 记录发现 scrape_configs: - job_name: 'webap ...
- Prometheus Consul实现自动服务发现
Prometheus Consul实现自动服务发现 1.概述 Consul 是一个支持多数据中心分布式高可用的服务发现和配置共享的服务软件. Consul 由 HashiCorp公司用Go语言开发 ...
- Ocelot + Consul + Registrator 基于Docker 实现服务发现、服务自动注册
目录 1. Consul集群搭建 1.1 F&Q Consul官方推荐的host网络模式运行 2. Registrator服务注册工具 2.1 F&Q Registrator悬挂服务 ...
- K8s基于DNS的服务发现(转)
原文地址:https://www.oschina.net/question/2657833_2201246 1.Kubernetes中如何发现服务 ◆ 发现Pod提供的服务 首先使用nginx-d ...
- prometheus服务发现机制
一. Prometheus与服务发现 1.1 目前支持的服务发现方式 二. 案例 2.1 基于文件的服务发现 2.2 基于Consul的服务发现 三.本地测试 3.1 基于文件的服务发现 1.测试环境 ...
随机推荐
- 完整且易读的最新版小程序登录态和检验注册过没的app.js写法
目录 0.可参考的官方页面 1.流程 2.app.js代码 3.java后台怎么通过code获取openId 0.可参考的官方页面 获取登录凭证:https://developers.weixin.q ...
- apache2.4
介绍 Apache HTTP server是Apache软件基金会的一个开源的网页服务器,可以运行在几乎所有广泛使用的计算机平台上,由于跨平台和安全性被广泛使用,是目前最流行的web服务器软件之一,目 ...
- Nginx 核心配置-检测文件是否存在
Nginx 核心配置-检测文件是否存在 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. try_files会按顺序检查文件是否存在,返回第一个找到的文件或文件夹(结尾加斜线表示为文件 ...
- Spring Cloud Sleuth + Zipkin 链路监控
原文:https://blog.csdn.net/hubo_88/article/details/80878632 在微服务系统中,随着业务的发展,系统会变得越来越大,那么各个服务之间的调用关系也就变 ...
- 监控进程cpu meminfo
https://github.com/cdrandin/cpsc_351 https://github.com/cdrandin?after=Y3Vyc29yOnYyOpK5MjAxNC0wNy0xM ...
- robot framework Selenium2library wait小问题
最近在使用selenium2Library时,用到其中的 Wait Until Page函数,因我们的网页相对比较敏感,经常获取不到,不明觉历 看看源码吧,如下: def wait_until_pag ...
- 如何解决飞秋FeiQ绑定端口错误
今天启动feiQ居然报错,绑定端口2425错误,如您正使用FeiQ或IPMsg,请先退出. error = 10049... 百度谷歌之后,本人如此解决 1.netstat -an 查看端口 2425 ...
- Selenium请求库
阅读目录 一 介绍 二 安装 三 基本使用 四 等待元素被加载 五 选择器 六 元素交互操作 七 其他 八 项目练习 九 破解登录验证 一 介绍 1.selenium是什么? selenium最初是一 ...
- 洛谷P1894 [USACO4.2]完美的牛栏The Perfect Stall题解
题目 二分图最大匹配问题 cow数组标现在牛栏里的牛是几号牛 每次寻找都要清空vis数组 如果可行有两种情况 1.这个牛栏里没有牛 2.这个牛栏里的牛可以到别的牛栏去 根据此递归即可 Code: #i ...
- Nothing to say
1. This moment will nap, you will have a dream; but this moment study, you will interpret a dream.此刻 ...