Chapter 5. Instrumenting Applications

It is easier to write an incorrect program than understand a correct one.

Alan J. Perlis1

Adding OpenTelemetry to all of your application services is an important part of getting started—and it’s definitely the most complex part. The process of setting up OpenTelemetry is twofold: installing the software development kit (SDK) and installing instrumentation. The SDK is the OpenTelemetry client responsible for processing and exporting the telemetry. Instrumentation is code written using the OpenTelemetry API to generate telemetry.

Instrumenting applications can be difficult and time-consuming. While some languages can automate this process, it’s very helpful to understand what the components actually are and how they relate to each other. Occasionally there are problems with installation, and it’s very difficult to debug a system you aren’t familiar with!

This book does not provide detailed setup instructions or code snippets. That’s what the documentation is for, and we don’t want to provide instructions that could be out-of-date by the time you read this. Instead, in this chapter we’ll provide a high-level overview of the entire installation process, descriptions of the components involved, and advice on what we consider to be best practices. Read this before you begin so you will better understand the goals you are trying to reach and know what to look for in the documentation.

It’s also possible to overinstrument an application, or to ...

Get Learning OpenTelemetry now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.