当前位置:网站首页>Boot actuator - Prometheus use
Boot actuator - Prometheus use
2022-07-02 22:55:00 【iiaythi】
boot actuator - prometheus - grafana
technological process
- boot application Provide statistics api, Such as http request
- prometheus from boot Collect and store
- grafana take prometheus Data display
docker prometheus To configure
version: '3.7'
networks:
monitor:
driver: bridge
services:
prometheus:
image: prom/prometheus
container_name: prometheus
hostname: prometheus
restart: always
user: root
volumes:
- ./prometheus/conf:/etc/prometheus
- ./prometheus/data:/prometheus
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
ports:
- "9090:9090"
networks:
- monitor
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
alertmanager:
image: prom/alertmanager
container_name: alertmanager
hostname: alertmanager
user: root
restart: always
volumes:
- ./alertmanager/conf:/etc/alertmanager
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
ports:
- "9094:9093"
networks:
- monitor
grafana:
image: grafana/grafana
container_name: grafana
hostname: grafana
user: root
restart: always
ports:
- "3000:3000"
volumes:
- ./grafana/data:/var/lib/grafana
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- monitor
node-exporter:
image: quay.io/prometheus/node-exporter
container_name: node-exporter
hostname: node-exporter
restart: always
user: root
ports:
- "9100:9100"
networks:
- monitor
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
To configure prometheus.yml
Configure scheduled tasks
$ cat prometheus/conf/prometheus.yml
# 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).
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'codelab-monitor'
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first.rules"
# - "second.rules"
# 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=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['192.xx.xx.10:9090']
- job_name: 'boot-prometheus' # Configured to monitor spring boot
metrics_path: '/actuator/prometheus' # spring boot Default exposed interface
static_configs:
- targets: ['172.xx.x.3:9999']
start-up docker-compose up -d
visit prometheus
http://localhost:9090
grafana Use
Add data sources prometheus
problem
“Error on ingesting samples that are too old or are too far into the future”
Container and host time are inconsistent , Or the difference is too much
边栏推荐
- [LeetCode] 回文数【9】
- 牛客网:最大子矩阵
- 數據分析學習記錄--用EXCEL完成簡單的單因素方差分析
- 杰理之内置关机电流 1.2uA,之后不能长按开机【篇】
- 杰理之直接触摸样机的顶针反应不正常【篇】
- Solve the error of changing the selected file when uploading excel file. Net:: err_ UPLOAD_ FILE_ CHANGED
- 数学建模——图与网络模型及方法(一)
- 【板栗糖GIS】arcscene—如何做出有高度的高程图
- kubernetes 使用主机名将 pod 分配在指定节点上
- World Environment Day | Chow Tai Fook serves wholeheartedly to promote carbon reduction and environmental protection
猜你喜欢
随机推荐
[LeetCode] 数组中的第K个最大元素【215】
创新实力再获认可!腾讯安全MSS获2022年度云原生安全守护先锋
【洛谷P1541】乌龟棋【DP】
Wait to solve the zombie process
P7072 [CSP-J2020] 直播获奖
[Luogu p1541] tortoise chess [DP]
Local dealers play the community group purchase mode and share millions of operations
Methods of adding styles to native JS
[LeetCode] 反转字符串中的单词 III【557】
分享 10 个 JS 闭包面试题(图解),进来看看你能答对多少
LeetCode 968. 监控二叉树
The kth largest element in the [leetcode] array [215]
[leetcode] there are duplicate elements [217]
MySQL查询附近的数据.并按距离进行排序.
Additional: [login information storage] and [login status verification]; (including: summarizing all the contents of [login information storage] and [login status verification] so far;)
go 4种单例模式
位的高阶运算
I admire that someone explained such an obscure subject as advanced mathematics so easily
杰理之直接触摸样机的顶针反应不正常【篇】
Jatpack------LiveData