Skip to content

Commit

Permalink
⭐ prometheus, grafana 추가
Browse files Browse the repository at this point in the history
- `script/server-with-metrics` 스크립트로 실행하면 prometheus, grafana
  연결
- localhost:3000 접속하면 grafana 확인할 수 있음
- grafana beam 대시보드
  - https://github.com/deadtrickster/beam-dashboards
  • Loading branch information
ohyecloudy committed Feb 16, 2020
1 parent f0ae55c commit 4af23e0
Show file tree
Hide file tree
Showing 13 changed files with 1,426 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dockerignore
@@ -0,0 +1 @@
deps
5 changes: 4 additions & 1 deletion CHANGELOG.org
Expand Up @@ -23,7 +23,10 @@
*** :star: Added

- merge request 프리뷰를 표시할 때, 파일 이름에 따라 출력할 메시지를 설정할 수 있다
- =config.exs= 파일에 =config :slab, merge_request_filename_descriptor:= 설정
+ =config.exs= 파일에 =config :slab, merge_request_filename_descriptor:= 설정
- prometheus, grafana로 지표(metrics)를 확인할 수 있다
+ =script/server-with-metrics= 스크립트로 실행
+ [[http://localhost:3000]] 사이트 방문

** [[https://github.com/ohyecloudy/slab/compare/v1.0.7...v1.0.8][v1.0.8]]

Expand Down
8 changes: 8 additions & 0 deletions README.org
Expand Up @@ -43,6 +43,14 @@ slack + gitlab.

인자는 [[https://en.wikipedia.org/wiki/List_of_tz_database_time_zones][List of tz database time zones]]를 참고한다.

*** prometheus, grafana와 같이 실행

#+BEGIN_EXAMPLE
$ script/server-with-metrics
#+END_EXAMPLE

실행 후 [[http://localhost:3000/]] 주소를 방문하면 grafana를 확인할 수 있다.

*** vagrant로 실행
#+BEGIN_EXAMPLE
$ vagrant up
Expand Down
7 changes: 7 additions & 0 deletions script/Dockerfile-grafana
@@ -0,0 +1,7 @@
FROM grafana/grafana:6.6.0

ENV GF_AUTH_DISABLE_LOGIN_FORM "true"
ENV GF_AUTH_ANONYMOUS_ENABLED "true"
ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"

ADD provisioning /etc/grafana/provisioning
2 changes: 2 additions & 0 deletions script/Dockerfile-prometheus
@@ -0,0 +1,2 @@
FROM prom/prometheus:v2.15.2
ADD prometheus.yml /etc/prometheus/
File renamed without changes.
30 changes: 30 additions & 0 deletions script/docker-compose.yml
@@ -0,0 +1,30 @@
version: '3'
services:
slab:
build:
context: ..
dockerfile: script/Dockerfile-slab
environment:
- TZ=Asia/Seoul
ports:
- "8081:8081"
prometheus:
build:
context: .
dockerfile: ./Dockerfile-prometheus
ports:
- "9090:9090"
depends_on:
- slab
volumes:
- prometheus-data:/prometheus
grafana:
build:
context: .
dockerfile: ./Dockerfile-grafana
ports:
- "3000:3000"
depends_on:
- prometheus
volumes:
prometheus-data:
21 changes: 21 additions & 0 deletions script/prometheus.yml
@@ -0,0 +1,21 @@
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
api_version: v1
scrape_configs:
- job_name: prometheus
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- slab:8081

0 comments on commit 4af23e0

Please sign in to comment.