Open iamabear09 opened 6 months ago
http://localhost:8080/actuator/metrics
http://[localhost:8080/actuator/metrics/jvm.memory.used
http://[localhost:8080/actuator/metrics/jvm.memory.used?tag=area:heap
Running Prometheus on Docker is as simple as
docker run -p 9090:9090 prom/prometheus
.The Prometheus image uses a volume to store the actual metrics.
Bind-mount your prometheus.yml from the host by running
docker run \
-p 9090:9090 \
-v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
bind-mount the directory containing prometheus.yml onto /etc/prometheus by running
docker run \
-p 9090:9090 \
-v /path/to/config:/etc/prometheus \
prom/prometheus
Prometheus data is stored
/prometheus
dir inside the container,To save your data
# Create persistent volume for your data
docker volume create prometheus-data
# Start Prometheus container
docker run \
-p 9090:9090 \
-v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml \
-v prometheus-data:/prometheus \
prom/prometheus
프로메테우스 컨테이너 dir 구조
prometheus dir 안에
prometheus.yml
이 존재한다. 따라서, Docker Image build 시 해당 위치에 나의prometheus.yml
를 설정해 주면 된다.FROM prom/prometheus ADD prometheus.yml /etc/prometheus/
Micrometer
수 많은 모니터링 Tool의 추상화라고 생각하면 된다.
스프링부트액츄에이터는 마이크로미터를 기본으로 내장
마이크로미터는다양한 지표(metrics) 수집 기능을 이미 만들어서 제공
지표 수집 url ::
http://localhost:8080/actuator/metrics/{name}
Prometheus & Grafana
등장 배경