HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🤩
개발
/데이터베이스(Database)/
Database
Database
/
Prometheus
Prometheus
/
Concepts(Data Model)

Concepts(Data Model)

Data Model

Metric names and labels

  • 모든 time series는 metric 이름과 옵셔널한 key-value 쌍의 label로 고유하게 식별됨
metric name은 시스템에서 계측되는 일반적인 feature를 명시함 (e.g http_requests_total)
  • regex [a-zA-Z_:][a-zA-Z0-9_:]*
  • colon은 recording rule이 적용될 때 사용함. 다른 경우 사용하지 않아야 함
Label은 프로메테우스의 dimensional data model을 가능케 해줌. 예를 들어 같은 metric에 대한 특정한 조합의 label은 해당 지표의 특정한 dimensional instantiation을 식별할 수 있게 해줌 ⇒ 그냥 쉽게 말해, Label을 통해서 metric 데이터에 대해 filter 걸 수 있다는 말. 이렇게 했을 때 새로운 time series를 생성할 수 있다
  • regex : [a-zA-Z_][a-zA-Z0-9_]*
  • __ 로 시작하는 label name은 내부적으로 사용하기 위해 예약된 것

Notation

  • metric name과 label이 주어졌을 때, time series는 아래 notation으로 고유하게 식별됨
<metric name>{<label_name>=<label value>, ...} example api_http_request_total{method="POST", handler="/messages"}

Metric Types

  • 프로메테우스의 client library 는 4개의 코어 metric 타입을 지원함
  • 프로메테우스 서버에서는 type 정보를 아직까지는 사용하지 않고 그냥 모든 데이터를 untyped time series로 펼치게 됨
  • Counter : 갯수 세기. 그냥 계속 증가하는 값
  • Gauge : single numerical value. 임의로 증가, 감소할 수 있는 값
  • Histogram : 관측값을 샘플링하고 식별가능한 bucket에다 담으면서 갯수를 셈
  • Summary : Histogram과 비슷하게 관측값을 샘플링하고, bucket에 담는게 아닌 관측값의 전체 갯수와 관측값의 합계 값을 제공
 

Gauge

Histogram

Summary