Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Table of Contents


Run Grafana on Container

Code Block
sansae@sansaeubuntu:~$
sansae@sansaeubuntu:~$ docker run -d --name=grafana -p 3000:3000 grafana/grafana
Unable to find image '--link prometheus grafana/grafana:latest' locally
latest: Pulling from grafana/grafana
532819f3e44c: Pull complete
e7412605fad5: Pull complete
b7d92b7a55e5: Pull complete
e191dcdfd42c: Pull complete
4220b2939540: Pull complete
4f4fb700ef54: Pull complete
d1db7be5c87f: Pull complete
ec5415c4ea67: Pull complete
Digest: sha256:ba39bf5131dcc0464134a3ff0e26e8c6380415249fa725e5f619176601255172
Status: Downloaded newer image for grafana/grafana:latest
2b0a8e78fd18bffb54e06379720bc72034107ac9ce0f74c371e092af5fbbfbb8
sansae@sansaeubuntu:~$ docker ps
CONTAINER ID   IMAGE
f2ec4bef42e0b774e21df3e0461879a1e94b97d8998a4d8b185e451c9b2d7f47
sansae@sansaeubuntu:~$
sansae@sansaeubuntu:~$ docker ps
CONTAINER ID   IMAGE             COMMAND                  CREATED        COMMAND STATUS    CREATED     PORTS
    STATUS         PORTS
NAMES
2b0a8e78fd18f2ec4bef42e0   grafana/grafana   "/run.sh"   7             9 seconds ago   Up 78 seconds   0.0.0.0:3000->3000/tcp, :::3000->3000/tcp   grafana
b9d0d4f676ba   prom/prometheus   "/bin/prometheus --c…"   9 minutes ago   Up 9 minutes   0.0.0.0:9090->9090/tcp, :::9090->9090/tcp   prometheus
sansae@sansaeubuntu:~$

Login Grafana

Info
  • NAT IP를 확인 합니다.
Code Block
sansae@sansaeubuntu:~$ curl ifconfig.me
52.141.35.146
  • NAT IP로 '3000' Port로 접속합니다.
  • 계정은 admin / admin 입니다.

Image Modified

  • 로그인이 성공하면 기본 Home이 보여 집니다.

Image Modified


Add Data Source of Prometheus

Info
  • Configuration → Data Sources → Add data source를 선택합니다.

Image Added

  • Prometheus를 선택합니다.

Image Added

  • Prometheus URL을 설정 합니다. (grafana 실행시 --link 옵션으로 prometheus를 설정했습니다.)

Image Added

  • Save & Test 로 저장 합니다.

Image Added

Create Dashboard

Info
  • Prometheus의 Sample Metric을 확인 합니다. ("scrape_samples_scraped")

Image Added

  • Grafana의 New Dashboard에서 Metrics: scrape_samples_scraped 로 설정하고 Apply  합니다.

Image Added

  • Dashboard가 저장되고 아래와 같이 보여집니다.

Image Added