当前位置:网站首页>Prometheus and grafana
Prometheus and grafana
2022-07-29 07:29:00 【jjt_!!】
A set of monitoring processes ,Prometheus Used to store monitoring data ,Grafana Display various data in the form of charts in the form of icons .
| plug-in unit | Default port | dashboard ID | remarks |
|---|---|---|---|
| Node Exporter | 9100 | 11074 | Monitoring server data |
| process exporter | 9256 | 249 | Data monitoring in the process dimension |
| redis_exporter | 9121 | monitor redis | |
| mysqld_exporter | 9104 | 7362 | monitor mysql |
Basic way to view data : curl localhost:port/metricsprometheus Original page of :http:ip:9090, Input the index quantity and other information to query the original data . In general use grafana Display the index quantity 
prometheus Configuration file for prometheus.yml, The basic format is shown in Figure .job_name Corresponding to one job, Multiple... Can be configured below targets,target Information about the machine where the corresponding plug-in is deployed ;
Use grafana Under the circumstances : install dashboard The way , Enter id that will do .id No. can be found on the official website 【https://grafana.com/grafana/dashboards】 Search for :
Node Exporter
Deploy on node machines , start-up : ./node_exporter
stay
Monitoring links : https://www.ipcpu.com/2021/04/prometheus-node_exporter/
stay prometheus Configuration on
- job_name: '44_141_pro'
static_configs:
- targets: ['10.130.44.141:9100']
process exporte
Official website address
https://github.com/ncabatoff/process-exporter/
Deploy
Monitor in the process dimension , Deploy on the nodes allowed by the process
Starting mode : ./process-exporter -config.path config.yml
Configuration mode :
process_names:
- name: "{
{.Comm}}"
cmdline:
- 'go-call-distrib'
name: Adapt to various matching rules
- { {.Comm}} Contains the basic name of the original executable , The second field in /proc//stat
- { {.ExeBase}} Contains the basic name of the executable { {.ExeFull}} The fully qualified path that contains the executable file
- { {.Username}} Contains the user name of a valid user { {.Matches}}map Contains applications cmdline regexps All matches generated
- { {.PID}} Contains the PID. Please note that , Use PID This means that the group will contain only one process .
- { {.StartTime}} Contains the start time of the process . This can be done with PID Use a combination of , because PID It will be reused over time .
- { {.Cgroups}} contain ( If the support ) Process cgroup (
/proc/self/cgroup). This is particularly useful for identifying which container the process belongs to .
process_names Must contain one or more selectors (comm,exe
or cmdline); If there are multiple selectors , They must all match . Each selector is a list of strings , For matching processes comm, argv[0], Or in
Under the circumstances cmdline, Is a regular expression applied to the command line .
stay prometheus Configuration on
- job_name: '44_141_pro'
static_configs:
- targets: ['10.130.44.141:9256']
redis_exporte
stay redis Deployed machine deployment
Start command (redis The connection of ip And password )./redis_exporter -redis.addr 10.130.44.103:6380 -redis.password 123456
stay prometheus Configuration on
- job_name: 'redis_exporter_targets'
static_configs:
- targets:
- redis://10.130.44.103:6380
- redis://10.130.44.103:6381
- redis://10.130.44.103:6382
- redis://10.130.44.141:6383
- redis://10.130.44.141:6384
- redis://10.130.44.141:6385
metrics_path: /scrape
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 10.130.44.103:9121
## config for scraping the exporter itself
- job_name: 'redis_exporter'
static_configs:
- targets:
- 10.130.44.103:9121
mysqld_exporter
stay mysql Machine deployment
Start command : ./mysqld_exporter --config.my-cnf=.mysqld_exporter.cnf
Where monitoring is required mysql Create users on the database :
grant select,replication client, process on *.* to 'mysql_monitor'@'localhost' identified by '123456';
flush privileges;
The configuration file ( Hide file formats ):
[client]
user=mysql_monitor
password=123456

stay prometheus Configuration on
- job_name: '44_103_mysql'
static_configs:
- targets: ['10.130.44.103:9104']
边栏推荐
- I, 28, a tester, was ruthlessly dismissed in October: I want to remind people who are still learning to test
- Remote invocation of microservices
- 新生代公链再攻「不可能三角」
- 用户列表 圆形头像并跟随小板块
- 1-后台项目搭建
- [summer daily question] Luogu p6336 [coci2007-2008 2] bijele
- 电子元器件贸易企业如何借助ERP系统,解决仓库管理难题?
- Does Flink support sqlserver databases? Get the changes of SQLSERVER database
- Segger's hardware anomaly analysis
- Round avatar of user list and follow small blocks
猜你喜欢

Some learning and understanding of vintage analysis

零数科技深度参与信通院隐私计算金融场景标准制定

电子元器件贸易企业如何借助ERP系统,解决仓库管理难题?

H3C_ Using setting default static routing priority to realize the active and standby function of export dual lines

Practice of online problem feedback module (XVII): realize the online download function of excel template

How does MySQL convert rows to columns?

leetcode力扣经典问题——4.寻找两个正序数组的中位数
Scala higher order (IX): pattern matching in Scala
![【暑期每日一题】洛谷 P7760 [COCI2016-2017#5] Tuna](/img/9a/f857538c574fb54bc1accb737d7aec.png)
【暑期每日一题】洛谷 P7760 [COCI2016-2017#5] Tuna

My personal website doesn't allow access to wechat, so I did this
随机推荐
计算程序运行时间 demo
My personal website doesn't allow access to wechat, so I did this
I'd like to ask, my flick job writes data in the way of upsert Kafka, but I'm more careful in MySQL
CFdiv1+2-Bash and a Tough Math Puzzle-(线段树单点区间维护gcd+总结)
logback日志级别简介说明
2-统一返回类DTO对象
【暑期每日一题】洛谷 P6336 [COCI2007-2008#2] BIJELE
关于大龄读博的几点回答?
MySQL 使用客户端以及SELECT 方式查看 BLOB 类型字段内容总结
Use of gcc/g++
Description of rollingfileappender attribute in logback
Latest 10 billion quantitative private placement list
zip gzip tar压缩进阶版
thinkphp6 实现数据库备份
Docker最新超详细教程——Docker创建运行MySQL并挂载
利用C语言巧妙实现棋类游戏——三子棋
论文阅读 (62):Pointer Networks
能在SQL 语句中 指定 内存参数吗?
2-unified return class dto object
Using C language to skillfully realize the chess game -- Sanzi chess