Skip to Content
Kubernetes Best Practices
book

Kubernetes Best Practices

by Brendan Burns, Eddie Villalba, Dave Strebel, Lachlan Evenson
November 2019
Intermediate to advanced
265 pages
6h 44m
English
O'Reilly Media, Inc.
Content preview from Kubernetes Best Practices

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 to each other but serve different purposes.

Metrics

A series of numbers measured over a period of time

Logs

Used for exploratory analysis of a system

An 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 perform an investigation of errors that are being emitted from the application.

Monitoring Techniques

Black-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. Black-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 cluster is healthy, we might schedule a pod, and if ...

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 in Production Best Practices

Kubernetes in Production Best Practices

Aly Saleh, Murat Karslioglu
Kubernetes Microservices

Kubernetes Microservices

Richard Chesterwood
Kubernetes Patterns

Kubernetes Patterns

Bilgin Ibryam, Roland Huß

Publisher Resources

ISBN: 9781492056461Errata Page