In the ever-evolving landscape of cloud-native applications build using microservices and containers and running on platforms like Kubernetes, observability has become paramount. Gathering data in the form of logs, metrics and traces has become the standard practice for understanding and troubleshooting these complex systems.
In this realm, OpenTelemetry has emerged as the de facto standard for collecting observability data. This post introduces you to OpenTelemetry Demo, a powerful tool that makes experimenting with OpenTelemetry a breeze.
OpenTelemetry: A Brief Overview
OpenTelemetry is more than just a buzzword; it’s a robust framework for collecting observability data from cloud-native applications. This is the second most-active project under the Cloud Native Computing Foundation (CNCF), second only to Kubernetes. Both end-users and vendors have embraced it as the go-to solution for observability needs.
Introducing OpenTelemetry Demo
To facilitate hands-on exploration of OpenTelemetry, the community has created the OpenTelemetry Demo. This demo offers a straightforward way to deploy “Astronomy Shop,” a microservices-based, polyglot application fully instrumented with OpenTelemetry client libraries.
It also includes an OpenTelemetry Collector to gather, process and export telemetry data to a backend of your choice. But that’s not all; the demo comes pre-loaded with simulated issues such as memory leaks, enabling users to experience the power of observability in action.
OpenTelemetry Demo went live during KubeCon NA 2022, marking its general availability. It’s now ready for you to dive in and explore. In the following sections, we’ll delve into the architecture, components and how to run and leverage this invaluable tool.
Architecture of OpenTelemetry Demo
The heart of OpenTelemetry Demo is Astronomy Shop, a mock online retailer boasting myriad astronomy products. This application is a testament to OpenTelemetry’s versatility, as it comprises over a dozen microservices written in various programming languages.
Furthermore, it incorporates key components such as Postgres, Kafka and Redis to mimic real-life applications, complete with data ingestion and persistence.
Key Features
Built-In Scenarios: OpenTelemetry Demo includes preset scenarios designed to simulate common issues for investigation.
Feature Flags: The demo allows you to toggle these scenarios on and off through a user-friendly UI, making it effortless to control the test environment.
Deployment Options
OpenTelemetry Demo is flexible in terms of deployment, offering options for both Docker and Kubernetes. By default, the installation deploys OpenTelemetry Collector (at the time of writing, it’s v0.76.1) along with local Prometheus, Jaeger and Grafana.
These serve as the backend for storing and analyzing observability data. However, you can easily replace this backend and direct telemetry data to any local or remote backend supported by OpenTelemetry Collector’s array of exporters.
Simulating Traffic
To simulate user traffic, the demo provides a load generator based on the Python load testing framework, Locust. It mimics users making requests to various routes from the frontend, allowing you to gauge the system’s performance under different loads.
Setting Up OpenTelemetry Demo
Before diving into OpenTelemetry Demo, ensure you have the following prerequisites:
- Docker, Docker Compose and Git installed.
- An observability analytics backend (if not using the demo’s default one).
Now, let’s walk through the setup steps:
- Clone the Demo: Begin by cloning the OpenTelemetry Demo from its GitHub repository.
- Retrieve Data Tokens: Obtain your data shipping tokens from your chosen observability backend. This is needed for the next configuration step for forwarding telemetry data.
- Configure OpenTelemetry Collector: Set up OpenTelemetry Collector to send telemetry data to your chosen backend by configuring the otelcol-config-extras.yml.
- Deployment: You can use Docker compose up to deploy the demo app. Once fully deployed, the Astronomy Shop should be available at http://localhost:8080/.
- Traffic Simulation: Use the built-in load generator to simulate user traffic and generate telemetry data. You can access it via the browser at http://localhost:8080/loadgen/.
- Verification: Ensure that the telemetry data is successfully reaching your chosen backend.
- Exploration: With data collected, stored and visualized, it’s time for the exciting part—investigating your application.
Exploring OpenTelemetry Demo
Now that your observability data is flowing, it’s time to dive into the OpenTelemetry Demo and its built-in simulated scenarios. These scenarios provide hands-on experience with problem-solving using OpenTelemetry data. The current release includes the following scenarios:
- Memory Leak Detection: Learn how to diagnose and address memory leaks using metrics and traces.
- Product Catalog Error: Investigate errors related to GetProduct requests with specific product IDs.
- Service Failures: Delve into sporadic failures in the ad service and cart service.
You can activate or deactivate these simulated issues using the Feature Flag service’s web UI at http://localhost:8080/feature/.
OpenTelemetry Demo is a powerful tool for anyone looking to explore the capabilities of OpenTelemetry and its applicability to observability needs. This community-maintained project provides a wide array of supported backends, offering flexibility and convenience in your explorations.
Don’t hesitate to dive in, tweak the codebase, experiment with application instrumentation or explore different configurations. OpenTelemetry Demo is your gateway to a deeper understanding of observability in the world of cloud-native applications.
Start exploring today and unlock the full potential of OpenTelemetry!
To hear more about cloud-native topics, join the Cloud Native Computing Foundation and the cloud-native community at KubeCon+CloudNativeCon North America 2023 – November 6-9, 2023.