Skip to Content
Kubernetes Best Practices, 2nd Edition
book

Kubernetes Best Practices, 2nd Edition

by Brendan Burns, Eddie Villalba, Dave Strebel, Lachlan Evenson
October 2023
Intermediate to advanced
324 pages
7h 46m
English
O'Reilly Media, Inc.
Book available
Content preview from Kubernetes Best Practices, 2nd Edition

Chapter 3. Monitoring and Logging in Kubernetes

In this chapter, we discuss best practices for monitoring and logging in Kubernetes. We’ll dive into the details of different monitoring patterns, important metrics to collect, and building dashboards from these raw metrics. We then wrap up with examples of implementing monitoring for your Kubernetes cluster.

Metrics Versus Logs

You first need to understand the difference between log collection and metrics collection. They are complementary but serve different purposes:

Metrics

A series of numbers measured over a period of time.

Logs

Logs keep track of what happens while a program is running, including any errors, warnings, or notable events that occur.

A example of where you would need to use both metrics and logging is when an application is performing poorly. Our first indication of the issue might be an alert of high latency on the pods hosting the application, but the metrics might not give a good indication of the issue. We then can look into our logs to investigate errors that are being emitted from the application.

Monitoring Techniques

Closed-box monitoring focuses on monitoring from the outside of an application and is what’s been used traditionally when monitoring systems for components like CPU, memory, storage, and so on. Closed-box monitoring can still be useful for monitoring at the infrastructure level, but it lacks insights and context into how the application is operating. For example, to test whether a ...

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

Kubernetes: Up and Running, 2nd Edition

Kubernetes: Up and Running, 2nd Edition

Brendan Burns, Joe Beda, Kelsey Hightower
Kubernetes Patterns, 2nd Edition

Kubernetes Patterns, 2nd Edition

Bilgin Ibryam, Roland Huss

Publisher Resources

ISBN: 9781098142155Errata PageSupplemental Content