Check out the Israel Data Stack: the ultimate resource for Israeli data companies.

[Digma] Improving Code Design With OpenTelemetry — A Practical Guide

Improving Code Design With OpenTelemetry — A Practical Guide - Roni Dover, CTO Digma
Better Programming
May 17, 2022

In a previous post, Roni Dover discussed the importance of observability in the modern developer stack and how it can help validate code assumptions. They introduced a sample application, an API for the Gringotts Wizarding Bank, to demonstrate observability in action.

To enable observability, the author provided two quick steps:

1. Launching the observability tools: They used Docker and Docker Compose to spin up several containers, including Jaeger (a distributed tracing system) and an OpenTelemetry collector (an observability router). They also introduced Digma, a tool for continuous feedback.

2. Instrumenting the application: They added OpenTelemetry packages to the project requirements and configured OpenTelemetry to send data to the observability router. They also demonstrated how to define spans in the code, representing logical breakdowns of processes.

With the application and observability set up, the author generated data and showcased the observability features. They used the Jaeger UI to visualize distributed traces, track performance, and identify issues in the code. They highlighted a suboptimal implementation causing repeated SQL calls and demonstrated how distributed tracing connected the dots between different components in a multiservice flow.

The author acknowledged the challenge of knowing when and how to explore observability data effectively. They emphasized the importance of continuous feedback and introduced Digma, a tool that ingests observability data to provide insights. They showcased the Digma VS Code plugin, which allows developers to toggle observability data for specific functions or code areas, providing relevant insights for code review and release.

Read more in Better Programming