Skip to content

Commit

Permalink
Prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
zhang committed Jul 5, 2019
1 parent 9e9de52 commit a1dac80
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
- [GoAccess 安装和配置](markdown-file/GoAccess-Install-And-Settings.md)
- [Portainer 安装和配置](markdown-file/Portainer-Install-And-Settings.md)
- [Influxdb 安装和配置](markdown-file/Influxdb-Install-And-Settings.md)
- [Prometheus 安装和配置](markdown-file/Prometheus-Install-And-Settings.md)
- [Grafana 安装和配置](markdown-file/Grafana-Install-And-Settings.md)
- [Ansible 安装和配置](markdown-file/Ansible-Install-And-Settings.md)
- [Wormhole + Flink 安装和配置](markdown-file/Wormhole-Install-And-Settings.md)
Expand Down
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
* [GoAccess 安装和配置](markdown-file/GoAccess-Install-And-Settings.md)
* [Portainer 安装和配置](markdown-file/Portainer-Install-And-Settings.md)
* [Influxdb 安装和配置](markdown-file/Influxdb-Install-And-Settings.md)
* [Prometheus 安装和配置](markdown-file/Prometheus-Install-And-Settings.md)
* [Grafana 安装和配置](markdown-file/Grafana-Install-And-Settings.md)
* [Ansible 安装和配置](markdown-file/Ansible-Install-And-Settings.md)
* [Wormhole + Flink 安装和配置](markdown-file/Wormhole-Install-And-Settings.md)
Expand Down
1 change: 1 addition & 0 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
- [GoAccess 安装和配置](markdown-file/GoAccess-Install-And-Settings.md)
- [Portainer 安装和配置](markdown-file/Portainer-Install-And-Settings.md)
- [Influxdb 安装和配置](markdown-file/Influxdb-Install-And-Settings.md)
- [Prometheus 安装和配置](markdown-file/Prometheus-Install-And-Settings.md)
- [Grafana 安装和配置](markdown-file/Grafana-Install-And-Settings.md)
- [Ansible 安装和配置](markdown-file/Ansible-Install-And-Settings.md)
- [Wormhole + Flink 安装和配置](markdown-file/Wormhole-Install-And-Settings.md)
Expand Down
3 changes: 2 additions & 1 deletion markdown-file/Grafana-Install-And-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ sudo systemctl status grafana-server

- dashboar仓库地址:<https://grafana.com/dashboards>
- 本地可以通过输入 dashboard id 导入别人模板

- 打开:<http://192.168.0.105:3000/dashboard/import>
- 输入对应的 id,点击 Load 即可

----------------------------------------------------------------------------------------------

Expand Down
81 changes: 81 additions & 0 deletions markdown-file/Prometheus-Install-And-Settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Prometheus 安装和配置

## Prometheus Docker 安装

- 官网:<https://prometheus.io/>
- 这里以 Spring Boot Metrics 为收集信息
- 创建配置文件:/Users/gitnavi/docker_data/prometheus/config/prometheus.yml
- 在 scrape_configs 位置下增加我们自己应用的路径信息

```
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
- job_name: 'springboot'
metrics_path: '/tkey-actuator/actuator/prometheus'
static_configs:
- targets: ['192.168.2.225:8811']
```

- 启动

```
docker run -d --name prometheus -p 9091:9090 \
-v /Users/gitnavi/docker_data/prometheus/config/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
```

- 然后配置 Grafana,使用这个 dashboard:<https://grafana.com/dashboards/10280>


----------------------------------------------------------------------------------------------

## 配置


### 微服务下的多服务收集

- <https://blog.csdn.net/zhuyu19911016520/article/details/88411371>


### 告警

- <https://blog.csdn.net/zhuyu19911016520/article/details/88627004>
- <https://www.jianshu.com/p/e59cfd15612e>

----------------------------------------------------------------------------------------------



----------------------------------------------------------------------------------------------


## 其他资料

- <>
- <>
- <>
- <>
- <>
- <>
- <>
- <>

0 comments on commit a1dac80

Please sign in to comment.