Skip to content

Prometheus + Grafana (ing...)

Set up

  • Docker Desktop: 설정 - Docker Engine
  • Linux: /etc/docker/daemon.json

아래 두 가지 설정 추가

"metrics-addr" : "0.0.0.0:9323",
"experimental" : true


docker-compose.yml
version: "3.9"
services:
  api-web:
    build: .
    environment:
     - NUM=4000
    ports:
      - "13583:13583"
    command:
      - "uvicorn"
      - "app.main:app"
      - "--host"
      - "0.0.0.0"
      - "--port"
      - "13583"

  prometheus:
    image: prom/prometheus:latest
    ports:
      - "9090:9090"

  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    depends_on:
      - prometheus

http://localhost:9323/metrics

: 도커 엔진이 HTTP API를 통해 외부로 공개하는 상태 정보

1


Prometheus http://localhost:9090

: Prometheus Web UI

2 3


http://localhost:9090/metrics

: promethues.yml 설정을 통해 수집한 측정값 4


Grafana http://localhost:3000

초기 암호: admin/admin

5

  • Add your fisrt data source 클릭
  • Prometheus 선택
  • HTTP - URL에 Prometheus 서버 정보 입력
  • Save & test

6

  • Create Dashboard
    (Grafana Example Dashboard - Promethues 2.0 Stats) 7

Quote