Book Image

Cloud-Native Observability with OpenTelemetry

By : Alex Boten
Book Image

Cloud-Native Observability with OpenTelemetry

By: Alex Boten

Overview of this book

Cloud-Native Observability with OpenTelemetry is a guide to helping you look for answers to questions about your applications. This book teaches you how to produce telemetry from your applications using an open standard to retain control of data. OpenTelemetry provides the tools necessary for you to gain visibility into the performance of your services. It allows you to instrument your application code through vendor-neutral APIs, libraries and tools. By reading Cloud-Native Observability with OpenTelemetry, you’ll learn about the concepts and signals of OpenTelemetry - traces, metrics, and logs. You’ll practice producing telemetry for these signals by configuring and instrumenting a distributed cloud-native application using the OpenTelemetry API. The book also guides you through deploying the collector, as well as telemetry backends necessary to help you understand what to do with the data once it's emitted. You’ll look at various examples of how to identify application performance issues through telemetry. By analyzing telemetry, you’ll also be able to better understand how an observable application can improve the software development life cycle. By the end of this book, you’ll be well-versed with OpenTelemetry, be able to instrument services using the OpenTelemetry API to produce distributed traces, metrics and logs, and more.
Table of Contents (17 chapters)
1
Section 1: The Basics
3
Chapter 2: OpenTelemetry Signals – Traces, Metrics, and Logs
5
Section 2: Instrumenting an Application
10
Section 3: Using Telemetry Data

Chapter 1: The History and Concepts of Observability

The term observability has only been around in the software industry for a short time, but the concepts and goals it represents have been around for much longer. Indeed, ever since the earliest days of computing, programmers have been trying to answer the question: is the system doing what I think it should be?

For some, observability consists of buying a one-size-fits-all solution that includes logs, metrics, and traces, then configuring some off-the-shelf integrations and calling it a day. These tools can be used to increase visibility into a piece of software's behavior by providing mechanisms to produce and collect telemetry. The following are some examples of telemetry that can be added to a system:

  • Keeping a count of the number of requests received
  • Adding a log entry when an event occurs
  • Recording a value for current memory consumption on a machine
  • Tracing a request from a client all the way to a backend service

However, producing high-quality telemetry is only one part of the observability challenge. The other part is ensuring that events occurring across the different types of telemetry can be correlated in meaningful ways during analysis. The goal of observability is to answer questions that you may have about the system:

  • If a problem occurred in production, what evidence would you have to be able to identify it?
  • Why is this service suddenly overwhelmed when it was fine just a minute ago?
  • If a specific condition from a client triggers an anomaly in some underlying service, would you know it without customers or support calling you?

These are some of the questions that the domain of observability can help answer. Observability is about empowering the people who build and operate distributed applications to understand their code's behavior while running in production. In this chapter, we will explore the following:

  • Understanding cloud-native applications
  • Looking at the shift to DevOps
  • Reviewing the history of observability
  • Understanding the history of OpenTelemetry
  • Understanding the concepts of OpenTelemetry

Before we begin looking at the history of observability, it's important to understand the changes in the software industry that have led to the need for observability in the first place. Let's start with the shift to the cloud.