prometheus + grafana 搭建

docker-compose.yml

复制代码
version: '3.8'

services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml

  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    ports:
      - "3000:3000"
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=admin
    volumes:
      - grafana_data:/var/lib/grafana

  node_exporter:
    image: prom/node-exporter:latest
    container_name: node_exporter
    ports:
      - "9100:9100"
      
volumes:
  grafana_data:

prometheus/prometheus.yml

复制代码
global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['prometheus:9090']

  - job_name: 'node_exporter'
    static_configs:
      - targets: ['node_exporter:9100']

启动

docker compose up -d

http://localhost:3000/

http://localhost:9100/

停止

docker compose down

相关推荐
京师20万禁军教头3 分钟前
37面向对象(高级)-main方法
java
书源丶4 分钟前
三十五、Java 泛型——类型安全的「万能模板」
java·开发语言·安全
dovens27 分钟前
SpringBoot集成MQTT客户端
java·spring boot·后端
❀͜͡傀儡师32 分钟前
Spring Boot 集成 RocksDB 实战:打造高性能 KV 存储加速层
java·spring boot·后端·rocksdb
BENA ceic1 小时前
Spring 的三种注入方式?
java·数据库·spring
小雅痞1 小时前
[Java][Leetcode middle] 209. 长度最小的子数组
java·算法·leetcode
二哈赛车手1 小时前
新人笔记---项目中简易版的RAG检索后评测指标(@Recall ,Mrr..)实现
java·开发语言·笔记·spring·ai
做时间的朋友。1 小时前
精准核酸检测
java·数据结构·算法
许彰午1 小时前
CacheSQL(五):桥接篇
java·数据库·缓存·系统架构
ATCH IERV1 小时前
Java实战:Spring Boot application.yml配置文件详解
java·网络·spring boot