页面“Golang”与“Monitoring with prometheus”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
 
 
第1行: 第1行:
 +
==
  
=learn=
 
  
[https://zhuanlan.zhihu.com/p/82324723 谈谈 Golang, 以及我走的一些弯路]
+
=book=
  
[https://www.zhihu.com/question/23486344 怎么学习 Golang]
+
[https://www.bookstack.cn/read/prometheus-book/README.md  Prometheus操作指南]
 +
=进阶=
 +
以后全改成自己 docker-compose build
  
https://studygolang.com/
+
[https://blog.51cto.com/wzlinux/2487300 prometheus 监控概述(一)有常用监控警告]
  
 +
[https://blog.51cto.com/wzlinux/2490670 PromQL 内置函数(三)]
  
[https://blog.csdn.net/weishixianglian/article/details/104582423 golang快速入门]
 
  
=install=
+
 
 +
[https://www.jb51.net/article/189679.htm  prometheus python 库编写自定义指标的方法(完整代码)]
 +
 
 +
=ins on docker-composer=
 +
https://gitee.com/atompi/PrometheusStackDockerCompose
 +
 
 +
=安全=
 
<pre>
 
<pre>
 +
node exporter 添加防火墙
 +
 +
curl -Lo /etc/yum.repos.d/_copr_ibotty-prometheus-exporters.repo https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/repo/epel-7/ibotty-prometheus-exporters-epel-7.repo
 +
# yum install node_exporter
 +
</pre>
 +
 +
=prometheus=
 +
[[Nginx用户密码认证配置 Basic HTTP authentication]]
  
从go 1.8开始,GOPATH环境变量现在有一个默认值,如果它没有被设置。 它在Unix上默认为$HOME/go,
+
不错的书
 +
https://yunlzheng.gitbook.io/prometheus-book/
  
wget -c https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz
 
  
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
 
  
tar  -xvf go1.14.4.linux-amd64.tar.gz  -C /usr/local/
 
  
#加入 添加到环境变量
+
[https://blog.csdn.net/lijiaocn/article/details/81865120 新型监控告警工具prometheus(普罗米修斯)的入门使用(附视频讲解)]
echo 'export PATH=$PATH:/usr/local/go/bin' >>/etc/profile  && source /etc/profile
 
  
vi /etc/profile
+
[https://www.lijiaocn.com/%E9%A1%B9%E7%9B%AE/2018/08/03/prometheus-usage.html#prometheus%E7%9A%84%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6 【视频】新型监控告警工具prometheus(普罗米修斯)入门使用(附视频讲解)]
export PATH=/usr/local/go/bin/:$PATH
 
#export GOPATH=/root/go/ #(可选设置) 如果你用root运行
 
export GOROOT=/usr/local/go/
 
#export GOARCH=amd64
 
#export GOOS=linux
 
export GOTOOLS=$GOROOT/pkg/tool
 
#export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
 
  
#export PATH=$PATH:/usr/local/gobin
+
[https://zhuanlan.zhihu.com/p/91215371 为什么说 Prometheus 是足以取代 Zabbix 的监控神器?]
  
source /etc/profile
+
[https://zhuanlan.zhihu.com/p/24811652 基于Prometheus的分布式在线服务监控实践]
  
 +
==usage==
 +
[https://www.jianshu.com/p/03cf0fc9c746 Grafana单图表告警邮件&面板图(Dashboard)日报邮件]
  
#export PATH=/usr/local/go/bin/:$PATH
+
[https://prometheus.io/docs/practices/rules/ Recording rules ]
#export GOPATH=/root
 
  
 +
https://github.com/prometheus/blackbox_exporter/blob/master/blackbox.yml
  
#以前的文章
+
=grafana=
#freebsd
+
<pre>
https://dl.google.com/go/go1.12.5.freebsd-amd64.tar.gz
+
#防火墙  grafana ng 在 10.3.10.10
#linux
+
  firewall-cmd  --permanent --add-rich-rule="rule family="ipv4" source address="10.3.10.10" port protocol="tcp" port="3000" accept "
  curl -o  go1.13.6.linux-amd64.tar.gz  https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz
+
firewall-cmd --reload
  
 +
</pre>
  
tar -C /usr/local -xzf go1.12.5.freebsd-amd64.tar.gz
 
  
 +
[https://grafana.com/docs/grafana/latest/installation/docker/ grafana.com Run Grafana Docker image]
  
 +
[https://grafana.com/grafana/dashboards/8919 中文 Node Exporte for Prometheus Dashboard]
  
export PATH=$PATH:/usr/local/go/bin
+
usage  creat-->import --> id  8919
  
source /etc/profile  #如果修改的是/etc/profile
+
Container
source $HOME/.profile  #如果修改的是$HOME/.profile
 
  
go version
 
  
  
 +
https://grafana.com/grafana/dashboards/11174
 +
 +
 +
docker-grafana/config.env  https://github.com/stefanwalther/docker-grafana/blob/master/config.env 
 +
 +
==grafana 添加源和数据 ==
 +
 +
[https://www.bookstack.cn/read/prometheus-book/quickstart-use-grafana-create-dashboard.md 使用Grafana创建可视化Dashboard]
 +
==grafana 添加用户 ==
 +
<pre>
 +
1.Users-->  2.Invite -->
 +
 +
3.进行邀请
 +
Email or Username:输入用户邮箱,建议先跟用户名保持相同,然后在后面在写邮箱,后面会说到,这样不会报错
 +
Name:输入用户名
 +
Role:配置用户权限(只读Viewer 编辑Editor 管理员Admin)
 +
Send invite email:勾选时,会将新用户的设置密码的链接发到邮箱
 +
 +
点击创建之后回调到新用户设置密码
 +
 +
-->
 +
 +
4.创建好之后,点击Pending Invites
 +
复制链接到浏览器的地址栏中访问(也可从邮件中收到链接)
 +
进去之后是下面的界面,这里有个坑,复制的IP地址是localhost,我们这里改为自己搭建的IP地址,然后在Email填写邮箱地址,设置新用户的密码
 +
设置完成后,会直接以新用户身份登陆
 +
 +
 +
http://localhost:3000/invite/PAhyq4gzfA3ugRiw0PH2RC2vsIuSTa
 +
 +
  -->
  
 
</pre>
 
</pre>
  
 +
[https://blog.csdn.net/liuxiangyang_/article/details/86737103  grafana的用户及权限的配置]
  
=ubuntu=
+
[https://blog.csdn.net/GX_1_11_real/article/details/85119451  grafana的用户及权限的配置]
 +
 
 +
[https://blog.csdn.net/kozazyh/article/details/93759717?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase  grafana-利用Google OAuth2 身份验证]
 +
 
 +
== ng config==
 
<pre>
 
<pre>
sudo add-apt-repository ppa:longsleep/golang-backports
+
cat gf.conf
sudo apt update
+
server
sudo apt install golang-go
+
{
 +
    listen 80;
 +
    server_name gf.linuxsa.org;
 +
#    access_log  /var/log/nginx/test-nuxt-bcb-blockchain-website.lliao.net.log;
 +
    #error_log /var/log/nginx/test-nux-bcb.evan.error.log;
 +
 
 +
 
 +
    client_max_body_size 10m;
 +
 
 +
    location / {
 +
      proxy_pass http://10.3.10.124:3000;
 +
      proxy_http_version 1.1;
 +
 
 +
#set_real_ip_from 10.0.0.0/8;
 +
#set_real_ip_from 172.16.0.0/12;
 +
#set_real_ip_from 192.168.0.0/16;
 +
#real_ip_header X-Forwarded-For;
 +
 
 +
        proxy_set_header        Host                $host;
 +
        proxy_set_header        X-Real-IP            $remote_addr;
 +
        proxy_set_header        X-Forwarded-For      $proxy_add_x_forwarded_for;
 +
        proxy_set_header        X-Remote-Port        $remote_port;
 +
        proxy_set_header        X-Forwarded-Proto    $scheme;
 +
        proxy_redirect          off;
 +
 
 +
          proxy_connect_timeout 1800s;
 +
          proxy_send_timeout 1800s;
 +
          proxy_read_timeout 1800s;
 +
 
 +
 
 +
 
 +
      real_ip_recursive on;
 +
#      real_ip_header X-Forwarded-For;
 +
#      set_real_ip_from 0.0.0.0/0;
 +
#      proxy_set_header Host            $host;
 +
#      proxy_set_header X-Real-IP $remote_addr;
 +
#      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 +
 
 +
 
 +
#proxy_set_header Host            $host:$server_port;
 +
#proxy_set_header    HTTP_X_FORWARDED_FOR $remote_addr;
 +
#proxy_set_header X-NginX-Proxy true;
 +
 
 +
#      proxy_set_header X-Real-IP        $remote_addr;
 +
#    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 +
#      proxy_set_header Upgrade $http_upgrade;
 +
#      proxy_set_header Connection "upgrade";
 +
    }
 +
}
  
 
</pre>
 
</pre>
https://github.com/golang/go/wiki/Ubuntu
 
=IDE=
 
  
==goland==
+
==使用教程==
进入goland的bin目录下执行./goland.sh
+
[https://yuerblog.cc/2019/01/04/grafana-usage/ grafana配置与简单使用]
 +
 
 +
[https://blog.csdn.net/bbwangj/article/details/81109615  Grafana使用教程]
 +
 
 +
[https://blog.csdn.net/Sagitarioo/article/details/102805852?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2  grafana数据可视化-使用教程]
 +
 
 +
[https://www.cnblogs.com/xkus/p/7462742.html  grafana快速入门 ]
 +
 
 +
[https://blog.csdn.net/u012062455/article/details/79214700  grafana使用教程之基本概念(basic concepts)]
  
Goland常用快捷键
+
[https://blog.csdn.net/weixin_42674978/article/details/102681969  Grafana从无到有的一个相当粗略的资料总结]
文件相关快捷键:
 
 
CTRL+E,打开最近浏览过的文件。
 
CTRL+SHIFT+E,打开最近更改的文件。
 
CTRL+N,可以快速打开struct结构体。
 
CTRL+SHIFT+N,可以快速打开文件。
 
代码格式化:
 
 
CTRL+ALT+T,可以把代码包在一个块内,例如if{…}else{…}。
 
CTRL+ALT+L,格式化代码。
 
CTRL+空格,代码提示。
 
CTRL+/,单行注释。CTRL+SHIFT+/,进行多行注释。
 
CTRL+B,快速打开光标处的结构体或方法(跳转到定义处)。
 
CTRL+“+/-”,可以将当前方法进行展开或折叠。
 
查找和定位
 
CTRL+R,替换文本。
 
CTRL+F,查找文本。
 
CTRL+SHIFT+F,进行全局查找。
 
CTRL+G,快速定位到某行。
 
代码编辑
 
 
ALT+Q,可以看到当前方法的声明。
 
CTRL+Backspace,按单词进行删除。
 
SHIFT+ENTER,可以向下插入新行,即使光标在当前行的中间。
 
CTRL+X,删除当前光标所在行。
 
CTRL+D,复制当前光标所在行。
 
ALT+SHIFT+UP/DOWN,可以将光标所在行的代码上下移动。
 
CTRL+SHIFT+U,可以将选中内容进行大小写转化。
 
  
===linux下Goland如何设置桌面快捷方式 ===
+
 
 +
[https://blog.csdn.net/Sagitarioo/article/details/102805852?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2  grafana数据可视化-使用教程]
 +
 
 +
[https://ken.io/note/grafana-quickstart-influxdb-datasource-graph Grafana快速入门:InfluxDB数据源以及曲线图表仪表盘配置]
 +
 
 +
 
 +
[https://www.cnblogs.com/fatyao/p/11192234.html Grafana报警]
 +
 
 +
 
 +
apached conf
 
<pre>
 
<pre>
ln -s  /opt/goland/bin/goland.sh /usr/bin/goland #我是这种在 awesome有效
+
##/etc/httpd/conf.d/gf.conf
  
  
goland打开后点击任务栏:
+
<VirtualHost *:80>
 +
      ServerName gf.linuxsa.org
 +
      ServerAlias gf.linuxsa.org
 +
   
 +
      ProxyRequests off
 +
   
 +
      <Proxy *>
 +
        Order deny,allow
 +
        Allow from all
 +
      </Proxy>
 +
   
 +
      <Location />
 +
        ProxyPass http://localhost:3000/
 +
        ProxyPassReverse http://localhost:3000/
 +
      </Location>
 +
    </VirtualHost>
  
tools---->create desktop entry.
+
</pre>
  
 +
=vm监控[[Node-exporter]]=
 +
可以如上的  node
 +
[[Node-exporter]]
  
#我的这个应该是没效果的
+
=Blackbox=
cat /usr/share/applications/goland.desktop
+
 
Version=1.0
+
[[Blackbox exporter]]
Type=Application
+
 
Name=GoLand
+
=pushgateway=
Icon=/opt/goland/bin/goland.png
+
 
Exec="/opt/goland/bin/goland.sh" %f
+
[[pushgateway]]
Comment=The Drive to Develop
+
 
Categories=Development;IDE;
+
[https://www.cnblogs.com/xiao987334176/p/9933963.html  基于Prometheus的Pushgateway实战 ]
Terminal=false
+
 
StartupWMClass=jetbrains-goland
+
https://songjiayang.gitbooks.io/prometheus/content/pushgateway/how.html
</pre>
 
  
[https://zhuanlan.zhihu.com/p/63248860 GO教程:安装Goland开发工具]
+
=[[Process-exporter]]=
  
[https://www.cnblogs.com/zhangguosheng1121/p/11448194.html  go安装与goland破解永久版]
+
=应用监控=
 +
==redis==
 +
[[prometheus监控Redis集群]]
  
==emacs==
+
[https://blog.csdn.net/weixin_43832846/article/details/90024274  pika主备部署(redis-sentinel)+监控(prometheus+grafana)]
  
 +
[https://blog.csdn.net/weixin_34289744/article/details/92725774?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-16.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-16.nonecase  Prometheus监控 Redis , redis-cli_exporter]
  
[https://blog.csdn.net/weishixianglian/article/details/104582423 golang快速入门[6.2<nowiki>]</nowiki>-集成开发环境-emacs详解]
+
==监控MQ==
https://github.com/golang/go/wiki/IDEsAndTextEditorPlugins
+
[https://www.rabbitmq.com/prometheus.html Monitoring with Prometheus & Grafana ]
  
https://emacs-china.org/t/topic/6469
+
==监控ES==
 +
https://github.com/slok/ecs-exporter
 +
==docker==
 +
[https://blog.csdn.net/palet/article/details/82889493?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-7.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-7.nonecase  Prometheus+grafana监控:cAdvisor输出的容器内存相关的指标的解读]
  
https://stackoverflow.com/questions/1715464/emacs-mode-for-go#1715502
+
== mysql==
 +
[https://blog.csdn.net/qq_25934401/article/details/82594478  prometheus 监控之 mysql 篇(含mysql报警规则)]
  
https://www.emacswiki.org/emacs/GoLangMode
+
[https://jiajunhuang.com/articles/2018_12_16-prometheus_mysqld_exporter.md.html Prometheus MySQL Exporter源码阅读与分析]
  
[https://www.cnblogs.com/wang_yb/p/4923168.html  Emacs中多个golang项目的配置方法 ]
+
[https://www.jianshu.com/p/27b979554ef8 python + promethues 监控mysql]
  
[https://studygolang.com/articles/6126  Emacs golang 配置 ]
+
==Spring boot==
 +
https://www.bookstack.cn/read/prometheus_practice/application-spring.md
  
https://www.cnblogs.com/lienhua34/p/5838166.html
 
  
https://github.com/lienhua34/myemacs-conf
+
[https://blog.csdn.net/liangcha007/article/details/86699013#7.%E5%85%B3%E4%BA%8Epushgateway  Prometheus基于java开发exporter样例以及pushgateway的应用]
  
https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/go
+
=告警=
  
https://blog.yuantops.com/tech/emacs-config-go-dev-environ/
+
[[Alertmanager]]
  
https://dreamerjonson.com/2019/11/24/emacs-package-for-golang/index.html
+
==telegram==
 +
通过 prome or grafana ?
  
https://github.com/dominikh/go-mode.el
+
[https://nova.moe/manage-host-alert-on-telegram-with-grafana/ 在 Telegram 中管理主机监控和警报信息]
  
https://github.com/alecthomas/gometalinter
+
https://github.com/inCaller/prometheus_bot
  
https://www.cnblogs.com/cobbliu/p/4860600.html
+
https://github.com/metalmatze/alertmanager-bot
  
[https://www.cnblogs.com/ibgo/p/5207025.html Emacs golang 配置 ]
+
[https://blog.csdn.net/weixin_34242331/article/details/91875514 基于prometheus + grafana + mysql + Telegram 监控告警]
  
 +
https://my.oschina.net/54188zz/blog/3030618
  
https://zhuanlan.zhihu.com/p/19902040
+
[https://yunlzheng.gitbook.io/prometheus-book/parti-prometheus-ji-chu/alert/prometheus-alert-rule 自定义Prometheus告警规则]
  
https://github.com/lryong/emacs-golang-conf
+
[https://www.linux.org.ru/forum/general/14894302  prometheus alertmanager telegram ]
  
https://chenyangguang.github.io/2018-11-27-ide/
+
=教程=
 +
[https://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_liunx_60_prometheus_config.html  prometheus学习系列五: Prometheus配置文件 ]
  
 
=see also=
 
=see also=
https://golang.google.cn/doc/install#install
 
  
  [[category:go]]
+
[https://www.jianshu.com/p/93412a925da2 规划 Prometheus 的存储用量]
 +
 
 +
[https://blog.csdn.net/lemon89/article/details/104088184 深入理解监控系统——Prometheus核心特点]
 +
 
 +
[https://blog.csdn.net/qq_21816375/article/details/80462445?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-12.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-12.nonecase prometheus部署node,server以及域名加告警]
 +
 
 +
[https://www.cnblogs.com/chenqionghe/p/10494868.html 从零搭建Prometheus监控报警系统]
 +
 
 +
[https://www.jianshu.com/p/1f05476ebcee 使用prometheus自定义监控]
 +
 
 +
[https://zhuanlan.zhihu.com/p/91215371 为什么说 Prometheus 是足以取代 Zabbix 的监控神器?]
 +
 
 +
[https://blog.51cto.com/wzlinux/2487300 prometheus 监控概述(一)]
 +
 
 +
 
 +
 
 +
[[category:ops]] [[category:container]] [[category:prom]]

2020年9月28日 (一) 08:41的版本

==


book

Prometheus操作指南

进阶

以后全改成自己 docker-compose build

prometheus 监控概述(一)有常用监控警告

PromQL 内置函数(三)


prometheus python 库编写自定义指标的方法(完整代码)

ins on docker-composer

https://gitee.com/atompi/PrometheusStackDockerCompose

安全

 node exporter 添加防火墙

curl -Lo /etc/yum.repos.d/_copr_ibotty-prometheus-exporters.repo https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/repo/epel-7/ibotty-prometheus-exporters-epel-7.repo
# yum install node_exporter

prometheus

Nginx用户密码认证配置 Basic HTTP authentication

不错的书 https://yunlzheng.gitbook.io/prometheus-book/



新型监控告警工具prometheus(普罗米修斯)的入门使用(附视频讲解)

【视频】新型监控告警工具prometheus(普罗米修斯)入门使用(附视频讲解)

为什么说 Prometheus 是足以取代 Zabbix 的监控神器?

基于Prometheus的分布式在线服务监控实践

usage

Grafana单图表告警邮件&面板图(Dashboard)日报邮件

Recording rules

https://github.com/prometheus/blackbox_exporter/blob/master/blackbox.yml

grafana

#防火墙   grafana ng 在 10.3.10.10
 firewall-cmd   --permanent --add-rich-rule="rule family="ipv4" source address="10.3.10.10" port protocol="tcp" port="3000" accept "
firewall-cmd --reload


grafana.com Run Grafana Docker image

中文 Node Exporte for Prometheus Dashboard

usage creat-->import --> id 8919

Container


https://grafana.com/grafana/dashboards/11174


docker-grafana/config.env  https://github.com/stefanwalther/docker-grafana/blob/master/config.env  

grafana 添加源和数据

使用Grafana创建可视化Dashboard

grafana 添加用户

1.Users-->  2.Invite --> 

3.进行邀请
Email or Username:输入用户邮箱,建议先跟用户名保持相同,然后在后面在写邮箱,后面会说到,这样不会报错
Name:输入用户名
Role:配置用户权限(只读Viewer 编辑Editor 管理员Admin)
Send invite email:勾选时,会将新用户的设置密码的链接发到邮箱

点击创建之后回调到新用户设置密码

 -->

4.创建好之后,点击Pending Invites
复制链接到浏览器的地址栏中访问(也可从邮件中收到链接)
进去之后是下面的界面,这里有个坑,复制的IP地址是localhost,我们这里改为自己搭建的IP地址,然后在Email填写邮箱地址,设置新用户的密码
设置完成后,会直接以新用户身份登陆


http://localhost:3000/invite/PAhyq4gzfA3ugRiw0PH2RC2vsIuSTa

  -->

grafana的用户及权限的配置

grafana的用户及权限的配置

grafana-利用Google OAuth2 身份验证

ng config

cat gf.conf 
server
{
    listen 80;
    server_name gf.linuxsa.org;
#    access_log  /var/log/nginx/test-nuxt-bcb-blockchain-website.lliao.net.log;
    #error_log /var/log/nginx/test-nux-bcb.evan.error.log;


    client_max_body_size 10m;
  
    location / {
      proxy_pass http://10.3.10.124:3000;
      proxy_http_version 1.1;

#set_real_ip_from 10.0.0.0/8;
#set_real_ip_from 172.16.0.0/12;
#set_real_ip_from 192.168.0.0/16;
#real_ip_header X-Forwarded-For;

        proxy_set_header        Host                 $host;
        proxy_set_header        X-Real-IP            $remote_addr;
        proxy_set_header        X-Forwarded-For      $proxy_add_x_forwarded_for;
        proxy_set_header        X-Remote-Port        $remote_port;
        proxy_set_header        X-Forwarded-Proto    $scheme;
        proxy_redirect          off;

          proxy_connect_timeout 1800s;
          proxy_send_timeout 1800s;
          proxy_read_timeout 1800s;



      real_ip_recursive on;
#      real_ip_header X-Forwarded-For;
#      set_real_ip_from 0.0.0.0/0;
#      proxy_set_header Host             $host;
#      proxy_set_header X-Real-IP $remote_addr;
#      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


#proxy_set_header Host             $host:$server_port;
#proxy_set_header    HTTP_X_FORWARDED_FOR $remote_addr;
#proxy_set_header X-NginX-Proxy true;

#      proxy_set_header X-Real-IP        $remote_addr;
 #     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#      proxy_set_header Upgrade $http_upgrade;
#      proxy_set_header Connection "upgrade";
    }
}

使用教程

grafana配置与简单使用

Grafana使用教程

grafana数据可视化-使用教程

grafana快速入门

grafana使用教程之基本概念(basic concepts)

Grafana从无到有的一个相当粗略的资料总结


grafana数据可视化-使用教程

Grafana快速入门:InfluxDB数据源以及曲线图表仪表盘配置


Grafana报警


apached conf
##/etc/httpd/conf.d/gf.conf


<VirtualHost *:80>
      ServerName gf.linuxsa.org
      ServerAlias gf.linuxsa.org
     
      ProxyRequests off
     
      <Proxy *>
        Order deny,allow
        Allow from all
      </Proxy>
     
      <Location />
        ProxyPass http://localhost:3000/
        ProxyPassReverse http://localhost:3000/
      </Location>
    </VirtualHost>

vm监控Node-exporter

可以如上的 node Node-exporter

Blackbox

Blackbox exporter

pushgateway

pushgateway

基于Prometheus的Pushgateway实战

https://songjiayang.gitbooks.io/prometheus/content/pushgateway/how.html

Process-exporter

应用监控

redis

prometheus监控Redis集群

pika主备部署(redis-sentinel)+监控(prometheus+grafana)

Prometheus监控 Redis , redis-cli_exporter

监控MQ

Monitoring with Prometheus & Grafana

监控ES

https://github.com/slok/ecs-exporter

docker

Prometheus+grafana监控:cAdvisor输出的容器内存相关的指标的解读

mysql

prometheus 监控之 mysql 篇(含mysql报警规则)

Prometheus MySQL Exporter源码阅读与分析

python + promethues 监控mysql

Spring boot

https://www.bookstack.cn/read/prometheus_practice/application-spring.md


Prometheus基于java开发exporter样例以及pushgateway的应用

告警

Alertmanager

telegram

通过 prome or grafana ?

在 Telegram 中管理主机监控和警报信息

https://github.com/inCaller/prometheus_bot

https://github.com/metalmatze/alertmanager-bot

基于prometheus + grafana + mysql + Telegram 监控告警

https://my.oschina.net/54188zz/blog/3030618

自定义Prometheus告警规则

prometheus alertmanager telegram

教程

prometheus学习系列五: Prometheus配置文件

see also

规划 Prometheus 的存储用量

深入理解监控系统——Prometheus核心特点

prometheus部署node,server以及域名加告警

从零搭建Prometheus监控报警系统

使用prometheus自定义监控

为什么说 Prometheus 是足以取代 Zabbix 的监控神器?

prometheus 监控概述(一)