当前位置:网站首页>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
边栏推荐
猜你喜欢

分享 10 个 JS 闭包面试题(图解),进来看看你能答对多少
![Gas station [problem analysis - > problem conversion - > greed]](/img/15/5313f900abedb46ce82d8ab81af1d7.png)
Gas station [problem analysis - > problem conversion - > greed]

图形视图框架

boot actuator - prometheus使用

NC50965 Largest Rectangle in a Histogram
![[leetcode] most elements [169]](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[leetcode] most elements [169]

创新实力再获认可!腾讯安全MSS获2022年度云原生安全守护先锋
![The kth largest element in the [leetcode] array [215]](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
The kth largest element in the [leetcode] array [215]

Jatpack------LiveData

Comprehensively analyze the logic of the shared purchase business model? How sharing purchase empowers Enterprises
随机推荐
[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
MySQL reset password, forget password, reset root password, reset MySQL password
Go 4 modes Singleton
Comprehensively analyze the logic of the shared purchase business model? How sharing purchase empowers Enterprises
[chestnut sugar GIS] ArcMap - why should the tick of classic capture be removed when using custom capture?
手写ORM(对象关系映射)增删改查
Addition, deletion, modification and query of handwritten ORM (object relationship mapping)
I admire that someone explained such an obscure subject as advanced mathematics so easily
【洛谷P1541】乌龟棋【DP】
[Luogu p1541] tortoise chess [DP]
数组进阶提高
Jerry's charge unplugged, unable to touch the boot [chapter]
PHP optimizes SQL queries in foreach
[leetcode] there are duplicate elements [217]
Webrtc audio and video capture and playback examples and mediastream media stream analysis
php实现根据输入的年龄查询出生日期符合的数据
uniapp微信登录返显用户名和头像
Uniapp wechat login returns user name and Avatar
[LeetCode] 回文数【9】
[LeetCode] 多数元素【169】