Prometheus 配置采集目标
Prometheus 配置采集目标
1、根据配置的任务(job)以http/s周期性的收刮(scrape/pull)
2、指定目标(target)上的指标(metric)。目标(target)
3、可以以静态方式或者自动发现方式指定。Prometheus将收刮(scrape)的指标(metric)保存在本地或者远程存储上。
使用scrape_configs定义采集目标
配置一系列的目标,以及如何抓取它们的参数。一般情况下,每个scrape_config对应单个Job。
目标可以在scrape_config中静态的配置,也可以使用某种服务发现机制动态发现。
# 任务名称,自动作为抓取到的指标的一个标签
job_name: <job_name> # 抓取周期
[ scrape_interval: <duration> | default = <global_config.scrape_interval> ]
# 每次抓取的超时
[ scrape_timeout: <duration> | default = <global_config.scrape_timeout> ]
# 从目标抓取指标的URL路径
[ metrics_path: <path> | default = /metrics ]
# 当添加标签发现指标已经有同名标签时,是否保留原有标签不覆盖
[ honor_labels: <boolean> | default = false ]
# 抓取协议
[ scheme: <scheme> | default = http ]
# HTTP请求参数
params:
[ <string>: [<string>, ...] ] # 身份验证信息
basic_auth:
[ username: <string> ]
[ password: <secret> ]
[ password_file: <string> ]
# Authorization请求头取值
[ bearer_token: <secret> ]
# 从文件读取Authorization请求头
[ bearer_token_file: /path/to/bearer/token/file ] # TLS配置
tls_config:
[ <tls_config> ] # 代理配置
[ proxy_url: <string> ] # DNS服务发现配置
dns_sd_configs:
[ - <dns_sd_config> ... ]
# 文件服务发现配置
file_sd_configs:
[ - <file_sd_config> ... ]
# K8S服务发现配置
kubernetes_sd_configs:
[ - <kubernetes_sd_config> ... ] # 此Job的静态配置的目标列表
static_configs:
[ - <static_config> ... ] # 目标重打标签配置
relabel_configs:
[ - <relabel_config> ... ]
# 指标重打标签配置
metric_relabel_configs:
[ - <relabel_config> ... ] # 每次抓取允许的最大样本数量,如果在指标重打标签后,样本数量仍然超过限制,则整个抓取认为失败
# 0表示不限制
[ sample_limit: <int> | default = 0
Prometheus 配置采集目标的更多相关文章
- Prometheus指标采集常用配置
一.node-exporter配置textfile收集器 textfile收集器作用: 运行暴露自定义指标.例如,需要在某个被监控节点上添加一个地理位置的指标. node-exporter会自动启动t ...
- prometheus配置
本文主要记录下测试环境积累的prometheus配置信息,主要是k8s基本节点的配置和cadvisor的配置,方便以后使用做为参考 global: scrape_interval: 30s scrap ...
- 实用干货丨如何使用Prometheus配置自定义告警规则
前 言 Prometheus是一个用于监控和告警的开源系统.一开始由Soundcloud开发,后来在2016年,它迁移到CNCF并且称为Kubernetes之后最流行的项目之一.从整个Linux服务器 ...
- prometheus 配置介绍
prometheus 配置介绍 prometheus 配置分global.alerting.rule_files.scrape_configs 1.global(全局配置) scrape_interv ...
- prometheus配置pushgateway功能测试
一.环境: 1.prometheus服务器ip:192.168.0.208 2.node-exporter客户机ip:192.168.0.202 二.测试设计考虑: pushgateway类似一台信息 ...
- prometheus 配置容器 cadvisor监控节点
安装cadvisor docker run \ --volume=/:/roofs:ro \ --volume=/var/run:/var/run:rw \ --volume=/sys:/sys:ro ...
- prometheus配置简介
参考网页:https://my.oschina.net/wangyunlong/blog/3060776 global: scrape_interval: 15s evalua ...
- prometheus配置详情
https://prometheus.io/docs/prometheus/latest/configuration/configuration/ 下面监控宿主机和容器的内存,CPU,磁盘等状态 gr ...
- Prometheus样本采集器汇总
系统基本信息 Linux Servers: Exporter https://github.com/prometheus/node_exporter Dashboard https://grafana ...
随机推荐
- nginx root与alias
root和alias都可以定义在location模块中,都是用来指定请求资源的真实路径,但又有区别: 采用如下设置 location /static/ { root /data/w3; } 实际访问h ...
- H5离线缓存(基础)学习指南
离线缓存 application cache 1. 什么是离线缓存: 离线缓存可以将站点的一些文件缓存到本地,它是浏览器自己的一种机制,将需要的文件缓存下来,以便后期即使没有连接网络,被缓存的页面也可 ...
- 5种处理Vue异常的方法
原文: Handling Errors in Vue.js 译者: Fundebug 本文采用意译,版权归原作者所有 去年一整年,我都在使用最爱的-Vue.js- 来做项目.最近突然意识到,我竟然从来 ...
- 浅谈MongoDB基础及架构
1.简述MongDB是一个强大.灵活而可扩展的数据存储系统,其将强大的可扩展特性与关系库最有用的特性进行了整合,像:次级索引,范围查询和排序等特性.而MongDB也内建了类似MapReduce汇聚和地 ...
- windows下使用ssh(利用paramiko库)
环境:python3.7.3 win7 or win10 1.首先下载paramiko库 命令:pip install paramiko 2.代码: import paramiko 创建一个 ssh ...
- ACM模板(转载)
转载自:https://blog.csdn.net/f_zyj/article/details/51594851 创建自:https://blog.csdn.net/ZDL_0908/article/ ...
- 使用面向对象思想封装js(附实例)
平时在写js时应该用面向对象思想将每一组功能封装成一个模块,可实现模块间的高内聚低耦合.重用.结构清晰........... 如果页面中逻辑复杂.功能多,不使用模块封装是不可想象的,维护起来非常复杂. ...
- Jupyter-notebook安装问题及解决
两种方式: 1.pip install jupyter notebook 2.安装Anaconda 1.pip安装 通过命令行pip,要注意是在哪个虚拟环境,安装好后jupyter notebook所 ...
- SFTP 文件上传下载工具类
SFTPUtils.java import com.jcraft.jsch.*; import com.jcraft.jsch.ChannelSftp.LsEntry; import lombok.e ...
- Android Studio 之 ROM【1】, Entity,Dao,Database
Android Studio 之 ROM, Entity,DAO,DataBase 1.Entity 实体类 package com.example.roombasic; import android ...