프로메테우스 Instrumentation Quantification

프로메테우스 가이드북
이민석's avatar
Jun 09, 2024
프로메테우스 Instrumentation Quantification

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

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

개요

작업 중인 모든 라이브러리, 하위 시스템 및 서비스에는 성능에 대한 대략적인 아이디어를 얻르 수 있는 몇가지 매트릭(Metric)이 있어야 합니다.

“Instrument Everything” - Every library, subsystem and service you are working on should have at least a few metrics that should give you a rough idea of how it’s performing

  • Instrument

    • Services

    • Libraries

Service Instrumentation

  1. Oneline-Serving Systems

  2. Offline-Processing Systems

  3. Batch Jobs

Online-Serving Systems

  1. 사람이나 다른 시스템이 즉각적인 응답을 기대하는 시스템입니다.

  2. 데이터베이스, 웹서버 및 HTTP 요청이 포함됩니다.

  3. 포함 대상

    1. 요청 비율(Request Rate)

    2. 레이턴시(Latency)

    3. 에러 비율(Error Rate)

    4. 진행 중인 요청(In-progress requests)

  4. 온라인 서빙 시스템은 Client, Server측 모두 모니터링 해야 합니다.

  • It’s a system where a human or some another system is expecting an immediate response.

    • Includes - databases, web servers and HTTP requests.

  • Key metrics to be included:

    • Request Rate

    • Latency

    • Error Rate

    • In-progress requests

  • Online-Serving System should be monitored on both the client and server side.

Offline-Serving Systems

  1. 오프라인 처리 시스템의 경우, 응답을 적극적으로 기다리는 사람이 없으며, 일괄 처리가 일반적입니다.

  2. 포함 대상

    1. 들어오는 항목 추적

    2. 진행 중인 항목 수

    3. 마지막으로 처리한 항목 수

    4. 발송된 항목 수

    5. 발생한 오류

  3. 일괄 처리하는 경우에는 일괄 처리와 개별 항목 모두에 대한 지표를 추적합니다.

  • For Offline-Processing Systems there is no one actively waiting for a response.

  • Batching is common. Multiple stages of processing.

    • e.g. A log processing system.

  • The key metrics that should be included:

    • Track the items coming in

    • How many are in progress

    • Last time you processed something

    • How many items were sent out

    • Errors that occur

  • If batching, then track the metrics both for batches and the individual items.

Batch Jobs

  1. 배치 작업은 오프라인 처리 시스템과 매우 유사합니다.

  2. 배치 작업은 연속적으로 실행되는 것이 아니라 정기적인 일정에 따라 실행됩니다.

  3. Push Gateway는 배치 작업을 스크랩하는데 사용됩니다.

  4. 포함 대상

    1. 실행에 걸린 시간

    2. 전체 실행 시간

    3. 작업이 마지막으로 완료된 시간 및 성공/실패 여부

  • Batch jobs are very similar to Offline-Processing Systems.

    Batch jobs don’t run continuously, they run on a regular schedule.

  • Push gateway used to scrap batch jobs.

  • The key metrics that should be included:

    • How long it took to run

    • Overall runtime

    • Time at which job last completed (successfule or failed)

Libraries

  1. 라이브러리는 사용자가 추가로 구성할 필요 없이 계측 기능을 제공해야 합니다.

  2. 라이브러리가 얼마나 무거운지에 따라 달라집니다.

  3. 포함 대상

    1. 라이브러리 내의 지연 시간

    2. 라이브러리가 프로세스 외부의 일부 리소스에 엑세스하는 경우,
      최소한 전체 쿼리 수와 지연 시간 추적

  • A library should provide instrumentation with no additional configuration required by users.

  • Depending on how heavy the library is; track:

    • Internal errors

    • Latency time within the library itself

  • If a library is used to access some resources outside of the process then at least track the overall query count and latency.

Details

프로메테우스가 로그를 수집하는 것은 무료가 아닙니다.

  1. Prometheus Capacity

    1. 5 million time series

    2. 2_000 app instances

  2. Metric count = 1 * 2_000 = 2_000

  3. Usage/Resource Utilization = (2_000 / 5_000_000) * 100 = 0.04%

  4. One Instance = 15 * 12 = 180 time series

  5. Usage / Resource Utilization = (2_000 * 180 / 5_000_000) * 100 = 7.2%

Share article
RSSPowered by inblog