Skip to Main Content
Prometheus: Up & Running
book

Prometheus: Up & Running

by Brian Brazil
July 2018
Beginner to intermediate content levelBeginner to intermediate
386 pages
9h 6m
English
O'Reilly Media, Inc.
Content preview from Prometheus: Up & Running

Chapter 14. Aggregation Operators

You already learned about aggregation in “Aggregation Basics”; however, this is only a small taste of what is possible. Aggregation is important. With applications with thousands or even just tens of instances it’s not practical for you to sift through each instance’s metrics individually. Aggregation allows you to summarise metrics not just within one application, but across applications too.

There are 11 aggregation operators in all, with 2 optional clauses, without and by. In this chapter you’ll learn about the different ways you can use aggregation.

Grouping

Before talking about the aggregation operators themselves, you need to know about how time series are grouped. Aggregation operators work only on instant vectors, and they also output instant vectors.

Let’s say you have the following time series in 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 ...
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.
Start your free trial

You might also like

Prometheus: Up & Running, 2nd Edition

Prometheus: Up & Running, 2nd Edition

Julien Pivotto, Brian Brazil
gRPC: Up and Running

gRPC: Up and Running

Kasun Indrasiri, Danesh Kuruppu

Publisher Resources

ISBN: 9781492034131Errata Page