首页
学习
活动
专区
圈层
工具
发布

Prometheus:配置

1、配置文件:prometheus.yml 2、默认有四个模块:global,alerting,rule_files,scrape_configs scrape_interval:15s evaluation_interval:15s

scrape_configs:

  • job_name: 'prometheus' static_configs: - targets: ["localhost:9090"] 3、promtool check config prometheus.yml 校验配置文件 4、图形界面:http://ip:9090/graph 数值界面:http://ip:9090/metrics 5、示例:查询5分钟的HTTP访问示例 sum(rate(promhttp_metric_handler_requests_total[5m])) by(job) 6、Prometheus主要需要内存和磁盘 所需内存计算规则:sum(count by (name) ({name=~".+"})),获取收集的样本量2bytes43200seconds(12小时)=所需内存,额外再加2G。10万个样本的内存所需10G左右 磁盘:路径--storage.tsdb.path 储存时间:--storage.tsdb.retention:15d 10万个样本的的磁盘所需大概259GB
举报
领券