Leveraging OpenTelemetry Instrumentation
Steve Flanders · 2024
This chapter explores the powerful capabilities of OpenTelemetry (OTel) instrumentation and how it can be leveraged to gain comprehensive insights into applications and infrastructure. Instrumentation is at the heart of observability, enabling readers to collect detailed telemetry data that illuminates the inner workings of their systems. OTel instrumentation documentation includes getting started information and multiple examples. In Python, metric instrumentation, like trace instrumentation, can be added through automatic or manual instrumentation. The general approach for metric instrumentation is very similar to traces just with metric-specific concepts. For logs, OTel leverages existing loggers, or objects that trigger log events, but enriches the data. The two primary enrichments would be metadata, including resource information, and trace correlation, including the trace ID. To enable trace correlation in log, trace instrumentation needs to be configured. OTel log instrumentation supports both automatic and manual methods and is in development.