프로메테우스 설치 및 UI 탐색

프로메테우스 가이드북
이민석's avatar
Jun 06, 2024
프로메테우스 설치 및 UI 탐색

프로메테우스 가이드북은 A to Z Metnros (Udemy) — Prometheus | The Complete Hands-On for Monitoring & Alerting를 듣고 작성한 가이드북입니다.

가이드북의 전체 목차 및 인덱싱은 프로메테우스 가이드북 — 소개 페이지를 참고해주세요.

개요

이 시리즈에서 사용할 Prometheus는 모든 운영체제에서 100% 작동하지 않습니다.

즉, 운영체제에 따라서 준비방식이 다르며, 이에 따라 특정한 에러가 발생할 수 있습니다.

따라서 튜토리얼에서 언급되지 않은 버그가 발생할 경우, 검색어에 운영체제를 포함하여 주세요.

Windows/MacOS

Windows/MacOS에서는 가상 환경을 구축하고 그 안에 Ubuntu를 준비하고 그 위에 Prometheus를 설치할 것입니다.

  1. VirtualBox 설치하기

  2. UbuntOS 설치하고 실행하기

UbuntuOS

UbuntuOS/LinuxOS는 자체 패키지 매니저를 사용해서 Prometheus를 설치할 것입니다.

UI 탐색

  1. Alerts

  2. Graph

  3. Status

    1. Runtime & Build Information

    2. Command-Line Flags

    3. Configuration

    4. Rules

    5. Targets

    6. Service Discovery

Prometheus Configuration File 이해하기

Prometheus의 작동에 대한 정의는 proemtheus.yml 파일에 이루어져 있습니다.

이 파일에 대한 이해도를 기르기 위해서 이번 챕터가 구성되었습니다.

UbuntuOS에 기본 설치되는 Prometheus 파일은 다음과 같습니다.

##################
# Global Configs #
##################
global:
  scrap_interval: 15s
  evaluation_interval: 15s

##############################
# AlertManager Configuration #
##############################
alerting:
  alertmanagers:
  - static_configs:
    - targets:

####################################################
# Load Rules once and periodically evaluate them.  #
#   according to the global 'evaulation_interval'  #
####################################################
rules_file:
  - "first_rules.yaml

####################################################
# A scrap configuration containing exactly one.    #
#.  endpoint to scrap: here it's prometheus itself #
####################################################
scrap_configs:
  - job_name:
    static_configs:
    - target: ['localhost:9090']

실제로 제공되는 Prometheus UI에서 아래와 같이 확인을 할 수 있습니다.

현재 타겟으로 잡혀있는 localhost:9090에 대해서 수집 중인 매트릭 정보들은 어떻게 확인할 수 있을까요? 그 경로는 다음과 같습니다.

Share article
RSSPowered by inblog