当前位置:网站首页>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] 多数元素【169】
- Storage unit conversion
- How can I use knockout's $parent/$root pseudovariables from inside a . computed() observable?
- PMP项目整合管理
- mysql重置密码,忘记密码,重置root密码,重置mysql密码
- 杰理之内置短按再长按,不管长按多长时间都是短按【篇】
- Additional: [login information storage] and [login status verification]; (including: summarizing all the contents of [login information storage] and [login status verification] so far;)
- Jatpack------LiveData
- NC24325 [USACO 2012 Mar S]Flowerpot
- Golang的学习路线
猜你喜欢
随机推荐
Mask R-CNN
大一学习分享
U++ learning note pile
杰理之如何测试按键的误触率【篇】
Golang的学习路线
Graphic view frame
Storage unit conversion
Oracle PL / SQL programming
分享 10 个 JS 闭包面试题(图解),进来看看你能答对多少
Jielizhi, production line assembly link [chapter]
[LeetCode] 存在重复元素【217】
【硬件】标准阻值的由来
【板栗糖GIS】arcmap—为什么使用自定义捕捉的时候,经典捕捉的勾要去掉呢?
创新实力再获认可!腾讯安全MSS获2022年度云原生安全守护先锋
Developers share | HLS and skillfully use Axi_ Customize the master bus interface instructions and improve the data bandwidth - area exchange speed
[autosar-dcm] - 4.3-how UDS $22 and $2e services read and write NVM data
杰理之快速触摸不响应问题【篇】
[LeetCode] 数组中的第K个最大元素【215】
#include errors detected. Please update your includePath.
The kth largest element in the [leetcode] array [215]






![NC24325 [USACO 2012 Mar S]Flowerpot](/img/cf/86acbcb524b3af0999ce887c877781.png)


