728x90

grafana 16

Grafana Alert 템플릿 커스텀 및 사용하기

우선 Template을 등록하는 방법은 아래와 같다. 1. Alerting에서 Contact points 탭을 선택 후 "New template"을 선택 2. Template 이름 입력 및 Content를 작성 3. Template Data에 마우스를 가져가면 아래처럼 팝업이 뜨는데 참고해서 작성 이번에는 Template을 사용하는 방법에 대해서 알아보자 우선 telegram을 연동하고 test 알림을 보내면 기본적으로 아래 형태로 메시지가 온다. **Firing** Value: [no value] Labels: - alertname = TestAlert - instance = Grafana Annotations: - summary = Notification test Silence: http://loca..

Grafana Alert 설정하기-2(Alert 조건 설정)

1. Datasource 선택 및 Query 작성 Reduce -> 각 인스턴스 하나하나 개별로 검토 Math -> 각 인스턴스의 결과값으로 조건 확인 A => 쿼리 B => 쿼리에서 나오는 인스턴스 각각의 결과값 C => 각 인스턴스의 결과값을 기준으로 조건 확인(사용시 $를 붙여서 사용한다) Grafana 버전이 올라가면서 각 instance마다 독립적으로 Alert을 받을 수 있다. ex) Grafana 예전 버전(쿼리 전체를 기준으로 하나의 Alert으로 작동) a,b,c,d,e instance 중 a가 alert 발생한 뒤 b가 alert 조건에 해당되도 추가적으로 alert이 오지 않음 ex) Grafana 최신 버전(각 instance가 독립적으로 Alert으로 작동) a,b,c,d,e in..

Grafana Alert 설정하기-1(telegram 연동)

1. 종 모양 클릭 2. Alerting에서 Contact points 탭을 선택한 뒤 New contact point 선택 3. 설정 세팅 Name Contact point type => telegram BOT API Token CHAT ID 입력 저장 전 Test를 통해 telegram에 정상적으로 메시지 전송이 되는지 확인이 가능하다 위 이미지에서 Test를 누르면 아래 화면이 뜨는데 "Send test notification"을 누르면 메시지가 아래 형식처럼 날아온다. **Firing** Value: [no value] Labels: - alertname = TestAlert - instance = Grafana Annotations: - summary = Notification test Sile..

Grafana log level, log 보관 기간 수정

1. log level 수정 - 아래 ;level = info에서 주석(;)을 풀고 debug, error 등 원하는 log level을 설정한다. (기본은 info level로 설정된다) /etc/grafana/grafana.ini 파일 수정 #################################### Logging ########################## [log] # Either "console", "file", "syslog". Default is console and file # Use space to separate multiple modes, e.g. "console file" ;mode = console file # Either "trace", "debug", "info", "..

Grafana , Prometheus 연동

1. Grafana 접속 - 최초 계정 : admin/admin 2. 설정 -> Data sources 선택 3. Add data source 선택 4. Prometheus 선택 5. URL 입력 : http://prometheusip:9090 - prometheus 기본 port는 9090이고 변경도 가능하다. 6. Save & Test 선택 7. 연결 확인 - 연결이 정상적이면 아래 사진처럼 초록색 이미지와 함께 Datasource updated라고 뜸. - 비정상적이면 빨간색 이미지와 함께 연결실패라는 문구가 뜸.

Grafana 설치

1. Grafana 설치 파일 다운로드 sudo wget https://dl.grafana.com/enterprise/release/grafana-enterprise_9.3.1_amd64.deb 2. 다운로드 받은 파일 압축 해제 sudo dpkg -i grafana-enterprise_9.3.1_amd64.deb 3. daemon-reload, 서비스 등록 ### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable gra..

728x90