Home / Companies / Honeycomb / Blog / Post Details
Content Deep Dive

Ask Miss O11y: Making Sense of OpenTelemetry—Context

Blog post from Honeycomb

Post Details
Company
Date Published
Author
Jessica Kerr (Jessitron)
Word Count
782
Language
English
Hacker News Points
-
Summary

OpenTelemetry Context is a complex abstraction that helps manage the flow of spans in distributed tracing by acting as a "you are here" marker, indicating where each span fits within a trace. Despite its simplicity as a key-value store, the context’s special feature is its ability to follow the thread of execution across distributed systems, encoding information into network calls to maintain a cohesive trace. This mechanism varies by programming language, with different implementations such as ThreadLocal storage in Java and AsyncLocalStorage in Node.js. The context is immutable, necessitating the creation of a new context when spans need to be linked as parent spans, particularly when integrating with spans created by libraries. This process involves extracting the active context, creating a new span, and establishing a new context, allowing for seamless integration of custom spans with auto-instrumented spans. Such distributed tracing provides a powerful tool for understanding software causality, although mastering it can be challenging, prompting the offer of further guidance from experts.