博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Prometheus(2)
阅读量:4564 次
发布时间:2019-06-08

本文共 2260 字,大约阅读时间需要 7 分钟。

 

  使用Prometheus:

  配置 prometheus.yml:

global:  scrape_interval:     15s # By default, scrape targets every 15 seconds.  # Attach these labels to any time series or alerts when communicating with  # external systems (federation, remote storage, Alertmanager).  external_labels:    monitor: 'codelab-monitor'# A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.scrape_configs:  # The job name is added as a label `job=
` to any timeseries scraped from this config. - job_name: 'prometheus' # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: 5s static_configs: - targets: ['localhost:9090']

启动 exporter

启动Prometheus

地址访问 : 

expression console:

global:  scrape_interval:     15s # By default, scrape targets every 15 seconds.  evaluation_interval: 15s # Evaluate rules every 15 seconds.  # Attach these extra labels to all timeseries collected by this Prometheus instance.  external_labels:    monitor: 'codelab-monitor'rule_files:  - 'prometheus.rules.yml'scrape_configs:  - job_name: 'prometheus'    # Override the global default and scrape targets from this job every 5 seconds.    scrape_interval: 5s    static_configs:      - targets: ['localhost:9090']  - job_name:       'example-random'    # Override the global default and scrape targets from this job every 5 seconds.    scrape_interval: 5s    static_configs:      - targets: ['localhost:8080', 'localhost:8081']        labels:          group: 'production'      - targets: ['localhost:8082']        labels:          group: 'canary'

配置scrape_config:

scrape_configs:  - job_name:       'example-random'    # Override the global default and scrape targets from this job every 5 seconds.    scrape_interval: 5s    static_configs:      - targets: ['localhost:8080', 'localhost:8081']        labels:          group: 'production'      - targets: ['localhost:8082']        labels:          group: 'canary'

 

 表达式:

avg(rate(rpc_durations_seconds_count[5m])) by (job, service)

告警规则配置:

groups:- name: example  rules:  - record: job_service:rpc_durations_seconds_count:avg_rate5m    expr: avg(rate(rpc_durations_seconds_count[5m])) by (job, service)

 

  

  

 

 

  

转载于:https://www.cnblogs.com/master-jack/p/8631198.html

你可能感兴趣的文章
剑指offer--1.二维数组中的查找
查看>>
第3次作业:团队介绍
查看>>
[html][javascript]父子窗体传值
查看>>
收房细则
查看>>
读《Android深度探索(卷1)HAL与驱动开发》的一些思考10
查看>>
二十三、uevnet机制和U盘自动挂载
查看>>
Kettle 提取mongodb最大编号
查看>>
Vue2.0-token权限处理
查看>>
Caffeine缓存
查看>>
JavaScript 回车键转成Tab键
查看>>
CentOS7配置MySQL5.7主备
查看>>
合并区间(LintCode)
查看>>
mysql索引的创建
查看>>
《 BCG 原创 :系列 三》 添加菜单栏
查看>>
Java中关于CyclicBarrier的使用
查看>>
vsftpd配置教程
查看>>
first ios app
查看>>
论javascript模块化的优缺
查看>>
css 冷门样式大全
查看>>
MYSQL 服务无法启动,错误日志:InnoDB: .\ibdata1 must be writable
查看>>