当前位置:网站首页>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
边栏推荐
- How should programmers write logs
- Developers share | HLS and skillfully use Axi_ Customize the master bus interface instructions and improve the data bandwidth - area exchange speed
- 首批 | 腾讯云完成国内首个云原生安全成熟度评估
- 解决 excel 文件上传时更改选中的文件出现错误net::ERR_UPLOAD_FILE_CHANGED
- Solve the error of changing the selected file when uploading excel file. Net:: err_ UPLOAD_ FILE_ CHANGED
- 【板栗糖GIS】arcscene—如何做出有高度的高程图
- The threshold value of fusing proportion cannot be changed with sentinel, and setting the slow call proportion has no effect
- To myself who is about to work
- Notes on key vocabulary in the English original of the biography of jobs (10) [chapter eight]
- #include errors detected. Please update your includePath.
猜你喜欢
随机推荐
牛客网:龙与地下城游戏
uniapp微信登录返显用户名和头像
Go语言sqlx库操作SQLite3数据库增删改查
Qt QSplitter拆分器
PMP项目整合管理
杰理之直接触摸样机的顶针反应不正常【篇】
分享 10 个 JS 闭包面试题(图解),进来看看你能答对多少
E-commerce system microservice architecture
[chestnut sugar GIS] ArcMap - how to batch modify the font, color, size, etc. of annotation elements
牛客网:最大子矩阵
go 4種單例模式
手写ORM(对象关系映射)增删改查
[leetcode] most elements [169]
[foreign journal] sleep and weight loss
Golang面试整理 三 简历如何书写
Jerry's modification does not require long press the boot function [chapter]
解决 excel 文件上传时更改选中的文件出现错误net::ERR_UPLOAD_FILE_CHANGED
Go condition variable
Film and television excerpts
【喜欢的诗词】好了歌








![[羊城杯2020]easyphp](/img/12/da28f738e50e625b0a66a94af3703d.png)