본문 바로가기
서버/Openwrt

grafana 로 데이터 보내기

by itsrainday 2024. 10. 27.

Node Exporter 컨테이너 실행

docker 컴포즈

version: '3.8'

services:
  node_exporter:
    image: quay.io/prometheus/node-exporter:latest
    container_name: node_exporter
    command:
      - '--path.rootfs=/host'
    network_mode: host
    pid: host
    restart: unless-stopped
    volumes:
      - '/:/host:ro,rslave'

설정의 참고

Prometheus 설정 파일 수정

Prometheus가 Node Exporter에서 메트릭을 수집할 수 있도록 prometheus.yml 파일을 수정해야 합니다

scrape_configs:
  - job_name: 'node-exporter'
    static_configs:
      - targets: ['localhost:9100']

Prometheus와 Grafana 연동

Grafana를 사용하여 시각화하려면 Grafana에서 Prometheus를 데이터 소스로 추가해야 합니다

  1. Grafana에 로그인하고 "Data Sources" 메뉴로 이동합니다.
  2. "Add data source"를 클릭하고 "Prometheus"를 선택합니다.
  3. URL에 Prometheus 서버 주소 (예: http://localhost:9090)를 입력하고 "Save & Test" 버튼을 클릭합니다
728x90