Skip to Content
Prometheus: Up & Running, 2nd Edition
book

Prometheus: Up & Running, 2nd Edition

by Julien Pivotto, Brian Brazil
May 2025
Beginner to intermediate
418 pages
6h 18m
Korean
O'Reilly Media, Inc.
Content preview from Prometheus: Up & Running, 2nd Edition

14장. 집계 연산자

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

'집계 기본 사항'에서 집계에 대해 이미 배웠지만, 이것은 가능한 것의 일부에 불과합니다. 집계는 중요합니다. 수천 개 또는 수십 개의 인스턴스가 있는 애플리케이션의 경우 각 인스턴스의 메트릭을 개별적으로 살펴보는 것은 실용적이지 않습니다. 집계를 사용하면 하나의 애플리케이션 내에서뿐만 아니라 여러 애플리케이션에 걸쳐 메트릭을 요약할 수 있습니다.

PromQL에는 12개의 집계 연산자와 2개의 선택적 절(withoutby)이 있습니다. 이 장에서는 집계를 사용할 수 있는 다양한 방법에 대해 알아봅니다.

그룹화

집계 연산자 자체에 대해 이야기하기 전에 시계열이 그룹화되는 방식에 대해 알아야 합니다. 집계 연산자는 인스턴트 벡터에서만 작동하며 인스턴트 벡터도 출력합니다.

Prometheus에 다음과 같은 시계열이 있다고 가정해 보겠습니다:

node_filesystem_size_bytes{device="/dev/sda1",fstype="vfat",
    instance="localhost:9100",job="node",mountpoint="/boot/efi"} 100663296
node_filesystem_size_bytes{device="/dev/sda5",fstype="ext4",
    instance="localhost:9100",job="node",mountpoint="/"} 90131324928
node_filesystem_size_bytes{device="tmpfs",fstype="tmpfs",
    instance="localhost:9100",job="node",mountpoint="/run"} 826961920
node_filesystem_size_bytes{device="tmpfs",fstype="tmpfs",
    instance="localhost:9100",job="node",mountpoint="/run/lock"} 5242880
node_filesystem_size_bytes{device="tmpfs",fstype="tmpfs",
    instance="localhost:9100",job="node",mountpoint="/run/user/1000"} 826961920
node_filesystem_size_bytes{device="tmpfs",fstype="tmpfs",
    instance="localhost:9100",job="node",mountpoint="/run/user/119"} 826961920

세 가지 계측 레이블이 있습니다: device, fstype, mountpoint 의 세 가지 계측 레이블이 있으며, jobinstance 의 두 가지 대상 레이블도 있습니다. 대상 및 계측 레이블은 여러분과 저희가 가지고 있지만 PromQL은 전혀 알지 못하는 개념입니다. 모든 레이블은 출처에 관계없이 PromQL에 관해서는 동일합니다.

없이

일반적으로 계측 레이블은 거의 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Prometheus: Up & Running, 2nd Edition

Prometheus: Up & Running, 2nd Edition

Julien Pivotto, Brian Brazil
Mastering Prometheus

Mastering Prometheus

William Hegedus
Argo CD: Up and Running

Argo CD: Up and Running

Andrew Block, Christian Hernandez
Kubernetes: Up and Running, 3rd Edition

Kubernetes: Up and Running, 3rd Edition

Brendan Burns, Joe Beda, Kelsey Hightower, Lachlan Evenson

Publisher Resources

ISBN: 9798341654181