개요

관심만 있다고 했는데요?

관심만 있다고 했는데요?

평소에 관심있었던 분야중에 모니터링 이었는데 이번 스터디를 통해서 많이 찾아보고 공부하게 되어서 구축하는 과정을 정리하게 됐다!

DataDog, AWS Cloudwatch, New Relic, Dynatrace 등 다양한 상용 모니터링 도구들이 있지만 비용 문제가 크게 화제되고 있어 오픈소스로 구축한 모니터링 도구들이 떠오르고 있다. (관리가 쉬운만큼 비용을 지불해야겠지?)

이번 스터디에서는 LGTM + Opentelemetry 기반을 사용하여 오픈소스 도구들로 진행할 예정이다!

오픈소스 목적
Grafana 모니터링 대시보드
Loki Log
Tempo Trace
Prometheus Metric
Alloy Collector
Opentelemetry Instrumentation

<aside> 💡

Kubernetes 환경에서 설치를 진행하며 각 오픈소스의 설치는 Helm Chart를 사용합니다.

</aside>

설치

Grafana 설치

먼저 Helm Repo를 등록합니다.

$ helm repo add grafana <https://grafana.github.io/helm-charts>
$ helm repo update
$ helm repo list

NAME                	URL
grafana             	<https://grafana.github.io/helm-charts>

개인적으로 helm chart를 다운로드 받아서 수정하는걸 좋아하기 때문에 최신 차트를 다운로드 받습니다.

$ helm pull grafana/grafana
$ tar xvfz grafana-8.8.2.tgz
$ cd grafana-8.8.2

취향에 맞게 values.yaml 파일을 수정해서 배포를 진행합니다. (기본 설정에서 Ingress 설정만 바꿔서 배포했습니다.)

$ vim vaules.yaml
$ helm install grafana . -f values.yaml -n monitoring --create-namespace
$ kubectl get po,ing -n monitoring # 설정한대로 잘 배포되었는지 확인

NAME                                                         READY   STATUS    RESTARTS   AGE
pod/grafana-5d56c6fcf7-p2qgh                                 1/1     Running   0          6d23h

NAME                                CLASS   HOSTS                   ADDRESS     PORTS   AGE
ingress.networking.k8s.io/grafana   nginx   grafana.local.example   localhost   80      6d23h