> For the complete documentation index, see [llms.txt](https://stephen-tsoi.gitbook.io/stephen-tsoi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stephen-tsoi.gitbook.io/stephen-tsoi-docs/opentelemetry/from-missing-events-to-complete-visibility-tracing-enterprise-transactions-with-opentelemetry/day-6-34-context-propagation.md).

# Day 6/34 Context Propagation

OpenTelemetry uses a Trace ID to correlate different spans that belong to the same execution flow, enabling end‑to‑end request tracing and visualization through the APM dashboard.

📌When a transaction is initiated, the trigger point generates a Trace ID and propagates it to downstream components in a structured format known as context. The context typically includes the following information:\
\*\*Trace ID – This unique identifier represents the entire trace flow. It is initially generated at the trigger point and then propagated throughout the entire trace flow.\
\*\*Span ID – This unique identifier distinguishes each step within the trace flow, acting as a fingerprint for individual steps.\
\*\*Parent Span ID – This refers to the span ID of the previous step, establishing the sequential order of each span within the trace flow.

As a message flows end‑to‑end, the upstream application injects the trace context into the outgoing request or message, while the downstream application extracts the context and continues the trace. This mechanism ensures trace continuity across multiple components within the same application. This process is known as context propagation. The actor to serialize and deserialize the context is propagators.

📌When trace context is propagated across different applications, all participating systems must follow agreed‑upon protocol standards for injecting and extracting trace information:\
\*\*RESTful / HTTP calls:\
OpenTelemetry follows the W3C Trace Context standard (W3C Trace Context Level 2), which defines the version, trace-id, parent-id and trace flag on\
HTTP headers for propagating trace information.\
\*\*Messaging systems:\
Since there is no universal standard across messaging protocols, trace context is typically propagated via message headers. This approach is commonly used for protocols such as MQTT, where OpenTelemetry trace metadata is manually injected and extracted according to implementation conventions.

<figure><img src="https://2617374589-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcQN1DZY6gJZPxlsQf9Re%2Fuploads%2FrVL0AlzNCfO8K8qdJeLH%2Fimage.png?alt=media&amp;token=f3e815cc-2e7b-4bc4-8403-50478b1b962e" alt=""><figcaption></figcaption></figure>

## 🚀 Let's Connect Beyond GitBook!

If you found this article helpful, you can find more of my technical insights, daily discussions, and deep dives across these platforms:

* **Read more of my work:** Check out my articles on [dev.to](https://dev.to/stephen_tsoi_5b2c4055f3a9) and [Hashnode](https://stephentsoi.hashnode.dev/).
* **Join the daily conversation:** Connect with me directly on [LinkedIn](https://www.linkedin.com/in/stephen-tsoi-16309730/).

***

#### 📬 Stay Ahead of the Curve

Enjoyed this piece? I break down complex technical topics into bite-sized, actionable insights every week.

👉 **Subscribe to my** [**LinkedIn Newsletter**](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7487299517642612736) to never miss an update and get the latest articles delivered straight to your feed!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://stephen-tsoi.gitbook.io/stephen-tsoi-docs/opentelemetry/from-missing-events-to-complete-visibility-tracing-enterprise-transactions-with-opentelemetry/day-6-34-context-propagation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
