🏏 450 million fans watched the last IPL. What is 'Cricket Scale' for SREs? Know More

Jun 9th, ‘23/11 min read

What is OpenTelemetry

Learn what is OpenTelemetry: The open-source observability framework for collecting and processing telemetry data from applications and systems.

Share:
What is OpenTelemetry

OpenTelemetry is an open-source observability framework designed to collect, process, and export telemetry data from applications and systems. It provides a set of specifications, APIs, libraries, agents, and instrumentation to enable the generation and collection of telemetry data, such as metrics, traces, and logs, from various sources within a software ecosystem and send them to various backends such Last9, legacy APMs, monitoring tools and open source tools.

The primary goal of OpenTelemetry (OTel) is to standardize and simplify observability practices across different programming languages, frameworks, and platforms. It allows developers to instrument their applications with a common set of APIs and SDKs, which can generate telemetry data. This data includes information about the application's behavior, performance, and operational characteristics to understand root causes. Above all, it’s vendor-agnostic and aims to create a standard for o11y tools that help modern cloud-native applications.

💡
By standardising instrumentation of data, the OpenTelemetry project aims to bring in more a more robust environment of o11y across practitioners. In a microservices world, this is critical to improve reliability of your systems.

OpenCensus

OpenCensus is an open-source project that provides libraries and tools to collect observability data (traces, metrics, and context propagation) from applications and services. It supports multiple programming languages and offers integrations with various backend systems for storage and analysis. OpenCensus was a precursor to OpenTelemetry and has now merged into it.

OpenTracing

OpenTracing is an open standard for distributed tracing that provides a consistent API and instrumentation approach across different programming languages and tracing systems. It allows developers to add instrumentation to their code and capture traces of requests as they propagate through microservices and other components. OpenTracing has also merged into OpenTelemetry to consolidate efforts and create a unified observability ecosystem.

The merging of OpenCensus and OpenTracing into OpenTelemetry aims to provide a unified and standard approach to observability instrumentation and data collection. OpenTelemetry is gaining popularity as the successor to these projects and is supported by a wide range of organizations and vendors in the observability space.

OpenTelemetry and Cloud Native Computing Foundation

OpenTelemetry is a incubating project that is hosted by the Cloud Native Computing Foundation (CNCF), which is an open-source software foundation that aims to advance the development and adoption of cloud-native technologies. The CNCF provides a vendor-neutral home for various projects and initiatives related to cloud-native computing.

OpenTelemetry is one of the CNCF's graduated projects, which means it has achieved a high level of maturity, adoption, and community support. Graduated projects in the CNCF are considered stable and production-ready, and they have demonstrated their ability to meet the CNCF's criteria for governance, sustainability, and community involvement.

As a CNCF incubating project, OpenTelemetry benefits from the resources, support, and collaboration opportunities offered by the CNCF community. It receives contributions from a wide range of organizations, including cloud providers, software vendors, and individual developers. The CNCF helps ensure the long-term sustainability and growth of OpenTelemetry by providing governance, infrastructure, and promoting industry collaboration.

Being part of the CNCF also means that OpenTelemetry aligns with the principles and goals of cloud-native computing. It aims to support observability and tracing in modern cloud-native architectures, making it easier for developers and operators to monitor and understand their distributed systems in a dynamic and Kubernetes cloud native environment.

The Importance of OpenTelemetry

Standardization

OpenTelemetry data provides a standardized and vendor-neutral approach to observability. It offers a consistent set of APIs, libraries, and tools that can be used across different programming languages, frameworks, and platforms. This standardization promotes interoperability and simplifies the integration of observability practices into applications and systems.

Consistent Instrumentation

The OpenTelemetry protocol allows developers to instrument their applications with a common set of APIs. This enables the generation of consistent and standardized telemetry data, including metrics, tracing data, and logs. Consistent instrumentation makes it easier to understand and compare the behavior and performance of different components within a distributed system. It also helps in avoiding manual instrumentation of data.

Comprehensive Observability

By collecting metrics, traces, and logs, OpenTelemetry provides comprehensive observability into applications and systems. It allows developers and operators to gain insights into the performance, behavior, and operational characteristics of their software. With observability, teams can better understand bottlenecks, troubleshoot issues, and optimize performance.

Distributed Systems Monitoring

Modern applications are often built as distributed systems, with various interconnected components. OpenTelemetry provides distributed tracing capabilities, allowing the capture and analysis of request paths and latency across different services. This helps in understanding the end-to-end flow of requests and identifying performance issues within complex distributed architectures.

Flexibility and Extensibility

OpenTelemetry is designed to be extensible, allowing end-users to integrate it with their preferred monitoring and observability platforms. It supports a wide range of exporters to transmit telemetry data to different backends, making it flexible and adaptable to existing monitoring infrastructures in real-time.

Community-driven

OpenTelemetry is an open-source project with an active and growing community. This means that it benefits from collaborative development, peer review, and contributions from a diverse range of individuals and organizations. The community helps drive innovation, improve the framework, and ensure its relevance and sustainability over time. The community also works on different use-cases to help advance the project.

OpenTelemetry plays a crucial role in enhancing observability practices and facilitating the monitoring, troubleshooting, and optimization of modern applications and distributed systems. DevOps and SRE teams benefit tremendously from having interoperable pipelines with a universally accepted standard. (Think USB-C ports)

Supported Telemetry Data Types

Metrics: It allows the collection of numerical data over time, such as CPU usage, memory consumption, request latency, or error rates. Metrics provide a way to quantify and measure various aspects of an application's performance.

Traces: Tracing involves capturing the path and timing of requests as they flow through different components of a distributed system. Traces provide detailed information about the latency and execution flow of individual requests, allowing for performance analysis and troubleshooting.

Logs: Logs capture textual records of events and activities happening within an application. They are useful for debugging, troubleshooting, and auditing purposes. OpenTelemetry provides a way to collect and correlate logs with other telemetry data for comprehensive observability.

Know more about metrics, logs, traces – key pillars of Observability.

Components in OpenTelemetry

APIs: OpenTelemetry defines a set of language-specific APIs that developers can use to instrument their applications and generate telemetry data. These APIs provide a consistent interface across different programming languages.

SDKs: Software Development Kits (SDKs) provide language-specific libraries and tools that implement the OpenTelemetry API. SDKs allow developers to instrument their applications and automatically generate telemetry data, which can be collected by exporters.

Exporters: Exporters are responsible for transmitting the telemetry data collected by the SDKs to various backends or observability platforms. They facilitate the integration between OpenTelemetry and existing monitoring, logging, and tracing systems.

Collectors: Collectors receive telemetry data from instrumented applications and route it to the appropriate backend or exporter. They can perform additional processing, aggregation, or transformation of the telemetry data before forwarding it.

By adopting OpenTelemetry, developers can achieve consistent observability across different environments and components of their applications. It promotes interoperability, making it easier to combine data from various sources, and enables better insights into the performance and behavior of complex distributed systems.

How does OpenTelemetry Work

OpenTelemetry works by providing a set of APIs, libraries, agents, and instrumentation to collect, process, and export telemetry data from applications and systems. It works on Open standards and open-source tools. Here's an overview of how OpenTelemetry operates:

Instrumentation: Developers use OpenTelemetry APIs and SDKs to instrument their applications. They add code snippets to capture relevant telemetry data, such as metrics, traces, and logs, at strategic points in the codebase. Instrumentation can be done at various levels, including application code, libraries, frameworks, and infrastructure components.

Telemetry Generation: Once the application is instrumented, the OpenTelemetry SDKs automatically generate telemetry data based on the defined instrumentation. For example, when an instrumented application receives a request, the SDK can generate a trace that captures the request's path and timing information, along with associated log entries and metric measurements.

Telemetry Collection: The generated telemetry data is collected by OpenTelemetry agents or libraries embedded within the application. These agents or libraries act as intermediaries, intercepting the telemetry data and preparing it for transmission.

Telemetry Export: OpenTelemetry provides exporters that transmit the collected telemetry data to various backends or observability platforms. Exporters can send telemetry data to monitoring systems, log aggregators, tracing platforms, or other destinations. OpenTelemetry supports a range of exporters, including popular platforms like Prometheus, Jaeger, Zipkin, and Elasticsearch.

Telemetry Processing: OpenTelemetry collectors receive the telemetry data from the instrumented applications or agents. Collectors can perform additional processing, aggregation, or transformation of the data before forwarding it to the designated exporters. This processing can include filtering, sampling, and enrichment of the telemetry data.

Data Visualization and Analysis: Once the telemetry data reaches the chosen backend or observability platform, it can be visualized, analyzed, and used for monitoring, troubleshooting, and optimization purposes. The platform provides tools, dashboards, and queries to explore the collected telemetry data and extract valuable insights.

OpenTelemetry is designed to be flexible and extensible, allowing users to integrate it into their existing monitoring infrastructure. It supports different programming languages, frameworks, and platforms, enabling consistent observability practices across diverse environments.

The collaborative efforts of the OpenTelemetry community drive the development and improvement of the project, ensuring its effectiveness, interoperability, and relevance in the evolving landscape of observability.

OpenTelemetry Protocol (OTLP)

OpenTelemetry OTLP (OpenTelemetry Protocol) is a key component of the OpenTelemetry project. It is a standardized protocol used for exporting telemetry data, such as traces and metrics, from instrumented applications to backend systems for analysis and visualization.

OTLP was designed with a focus on performance, flexibility, and compatibility. It provides a compact and efficient wire format for transmitting telemetry data over the network, reducing the overhead associated with data transmission.

The OpenTelemetry project defines OTLP as a specification, including the wire format and encoding rules. It allows various observability platforms and backend systems to implement support for OTLP, enabling seamless interoperability between instrumented applications and these systems.

The OTLP specification supports different data types, including traces, metrics, and logs. It defines a set of messages and data models for these telemetry data types, allowing for the transmission of rich and structured information.

OpenTelemetry provides client libraries and SDKs in various programming languages, which include built-in support for exporting telemetry data using OTLP. These libraries abstract the complexity of encoding and transmitting data in the OTLP format, making it easier for developers to integrate with backend systems that support OTLP.

Many observability platforms and backend systems have added support for OTLP as part of their integrations with OpenTelemetry. This enables users to seamlessly export telemetry data from their instrumented applications to these systems using the standardized OTLP protocol.

Credits: https://opentelemetry.io/docs/collector/
Credits: https://opentelemetry.io/docs/collector/

Auto Instrumentation vs Manual instrumentation

OpenTelemetry supports both auto-instrumentation and manual instrumentation approaches to capture telemetry data in applications. Let's explore the differences between these two methods:

Auto-Instrumentation

Auto-instrumentation refers to the process of automatically instrumenting an application's code without requiring explicit modifications by the developer. OpenTelemetry provides libraries and integrations for popular frameworks, libraries, and technologies that automatically instrument the application code to capture telemetry data. This approach reduces the developer's burden of manually adding instrumentation code.

Benefits of auto-instrumentation include:

- Ease of use: Auto-instrumentation simplifies the process of adding instrumentation to an application. Developers can integrate OpenTelemetry with their existing frameworks and libraries without making manual modifications.

- Consistency: Auto-instrumentation ensures a consistent approach to capturing telemetry data across different components of the application. It provides standard instrumentation for commonly used frameworks, ensuring that critical operations and interactions are captured without additional effort.

- Reduced developer effort: Developers can focus on writing application logic rather than spending time on manual instrumentation.

Manual Instrumentation

Manual instrumentation involves explicitly adding code to instrument specific parts of the application to capture telemetry data. Developers have more control over what gets instrumented and can customize the instrumentation based on specific requirements. OpenTelemetry provides APIs and libraries that allow developers to manually add instrumentation code at key points in their applications.

Benefits of manual instrumentation include:

- Fine-grained control: Developers can precisely instrument specific operations, functions, or code blocks that are critical for capturing detailed telemetry data. This level of control allows for more targeted observability.

- Customization: Manual instrumentation enables developers to customize the instrumentation according to their specific needs and application architecture. They can define custom spans, add context, and handle specific edge cases as required.

- Flexibility: Manual instrumentation can be used in scenarios where auto-instrumentation is not available or is not sufficient for capturing the desired telemetry data.

The choice between auto-instrumentation and manual instrumentation depends on various factors, such as the complexity of the application, the availability of auto-instrumentation support for the used frameworks, and the specific requirements for capturing telemetry data. In many cases, a combination of both approaches may be used to achieve comprehensive observability coverage in an application.

Support for Programming Languages

OpenTelemetry provides language-specific libraries and SDKs to support instrumentation and telemetry collection in a wide range of programming languages. The project aims to offer a consistent developer experience across different languages, allowing developers to easily integrate observability capabilities into their applications.

1. Java: OpenTelemetry provides libraries and instrumentation for Java applications, including support for automatic instrumentation of popular frameworks and libraries.

2. JavaScript/Node.js: OpenTelemetry offers libraries and integrations for Node.js applications, enabling developers to instrument their Node.js-based services and capture telemetry data.

3. Python: OpenTelemetry provides libraries and integrations for Python applications, supporting automatic instrumentation of popular Python frameworks and libraries.

4. Go: OpenTelemetry offers libraries and integrations for Go applications, allowing developers to instrument their Go-based services and collect telemetry data.

5. .NET: OpenTelemetry provides libraries and integrations for the .NET ecosystem, including support for instrumentation of ASP.NET, ASP.NET Core, and other .NET frameworks.

6. Ruby: OpenTelemetry offers libraries and integrations for Ruby applications, enabling developers to instrument their Ruby-based services and capture telemetry data.

7. PHP: OpenTelemetry provides libraries and integrations for PHP applications, supporting automatic instrumentation of popular PHP frameworks and libraries.

8. C++: OpenTelemetry offers libraries and integrations for C++ applications, allowing developers to instrument their C++ code and collect telemetry data.

OpenTelemetry also has experimental support for additional languages, including Rust, Swift, and Objective-C. The project continues to evolve and expand its language support based on community contributions and demand.

Telemetry vs OpenTelemetry

Telemetry: Telemetry refers to the automated collection and transmission of data about the behavior, performance, and operational characteristics of systems or applications. It involves the measurement and reporting of various metrics, events, traces, logs, or other data points that provide insights into the system's operation. Telemetry is a broader term that encompasses the practice of collecting and analyzing data for monitoring, analysis, and optimization purposes.

OpenTelemetry: OpenTelemetry is a specific open-source observability framework. It is an implementation of the broader concept of telemetry, designed to standardize and simplify the collection, processing, and export of telemetry data from applications and systems. OpenTelemetry provides a set of APIs, SDKs, agents, and exporters that developers can use to instrument their applications and generate telemetry data. It focuses on capturing metrics, traces, and logs, and facilitates the integration of telemetry data with various monitoring, logging, and tracing systems.

Telemetry is the general practice of collecting and transmitting data about system behavior, while OpenTelemetry is a specific framework that provides Observability tools and standards to enable telemetry data collection and export for observability purposes.

What is OpenTelemetry not?

OpenTelemetry is not a monitoring or alerting tool. While it provides the means to collect telemetry data from applications and systems, it does not offer built-in monitoring capabilities or the ability to configure alerts based on that data. OpenTelemetry focuses on the collection, processing, and export of telemetry data, leaving the monitoring and alerting aspects to other specialized tools and platforms that can consume the exported telemetry data.

Conclusion

OpenTelemetry is an open-source observability framework that standardizes and simplifies the collection, processing, and export of telemetry data from applications and systems. It provides APIs, SDKs, and instrumentation to generate metrics, traces, and logs, promoting interoperability across different languages and platforms. By merging OpenCensus and OpenTracing, OpenTelemetry offers a unified observability ecosystem. Hosted by the Cloud Native Computing Foundation, it benefits from community support and aligns with cloud-native principles. OpenTelemetry enables consistent instrumentation, comprehensive observability, monitoring of distributed systems, flexibility, and extensibility. It follows the OpenTelemetry Protocol (OTLP) for exporting telemetry data, ensuring compatibility. In conclusion, OpenTelemetry enhances observability practices, helping organizations monitor, troubleshoot, and optimize their applications and systems dependencies.

💡
The Last9 promise — We will reduce your TCO by about 50%. Our managed time series database data warehouse, Levitate, comes with streaming aggregation, data tiering, and the ability to manage high cardinality. If this sounds interesting, talk to us.

Contents


Newsletter

Stay updated on the latest from Last9.

Authors

Last9

Last9 helps businesses gain insights into the Rube Goldberg of micro-services. Levitate - our managed time series data warehouse is built for scale, high cardinality, and long-term retention.