diff --git a/tutorial/content/labs/instrumentation/manual/traces/images/create_tracer_configure_pipeline.drawio.png b/tutorial/content/labs/instrumentation/manual/traces/images/create_tracer_configure_pipeline.drawio.png new file mode 100644 index 0000000..b25c603 Binary files /dev/null and b/tutorial/content/labs/instrumentation/manual/traces/images/create_tracer_configure_pipeline.drawio.png differ diff --git a/tutorial/content/labs/instrumentation/manual/traces/images/create_tracer_configure_pipeline.drawio.xml b/tutorial/content/labs/instrumentation/manual/traces/images/create_tracer_configure_pipeline.drawio.xml new file mode 100644 index 0000000..978026c --- /dev/null +++ b/tutorial/content/labs/instrumentation/manual/traces/images/create_tracer_configure_pipeline.drawio.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tutorial/content/labs/instrumentation/manual/traces/images/enrich_spans_with_context.drawio.png b/tutorial/content/labs/instrumentation/manual/traces/images/enrich_spans_with_context.drawio.png new file mode 100644 index 0000000..3b7d4e1 Binary files /dev/null and b/tutorial/content/labs/instrumentation/manual/traces/images/enrich_spans_with_context.drawio.png differ diff --git a/tutorial/content/labs/instrumentation/manual/traces/images/enrich_spans_with_context.drawio.xml b/tutorial/content/labs/instrumentation/manual/traces/images/enrich_spans_with_context.drawio.xml new file mode 100644 index 0000000..7db2eb2 --- /dev/null +++ b/tutorial/content/labs/instrumentation/manual/traces/images/enrich_spans_with_context.drawio.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tutorial/content/labs/instrumentation/manual/traces/images/trace_propagation.drawio.png b/tutorial/content/labs/instrumentation/manual/traces/images/trace_propagation.drawio.png new file mode 100644 index 0000000..fd9b2f3 Binary files /dev/null and b/tutorial/content/labs/instrumentation/manual/traces/images/trace_propagation.drawio.png differ diff --git a/tutorial/content/labs/instrumentation/manual/traces/images/trace_propagation.drawio.xml b/tutorial/content/labs/instrumentation/manual/traces/images/trace_propagation.drawio.xml new file mode 100644 index 0000000..1ec6a54 --- /dev/null +++ b/tutorial/content/labs/instrumentation/manual/traces/images/trace_propagation.drawio.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tutorial/content/labs/instrumentation/manual/traces/images/tracer_generates_spans.drawio.png b/tutorial/content/labs/instrumentation/manual/traces/images/tracer_generates_spans.drawio.png new file mode 100644 index 0000000..2353775 Binary files /dev/null and b/tutorial/content/labs/instrumentation/manual/traces/images/tracer_generates_spans.drawio.png differ diff --git a/tutorial/content/labs/instrumentation/manual/traces/images/tracer_generates_spans.drawio.xml b/tutorial/content/labs/instrumentation/manual/traces/images/tracer_generates_spans.drawio.xml new file mode 100644 index 0000000..f462575 --- /dev/null +++ b/tutorial/content/labs/instrumentation/manual/traces/images/tracer_generates_spans.drawio.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tutorial/content/labs/instrumentation/manual/traces/index.md b/tutorial/content/labs/instrumentation/manual/traces/index.md index 99120db..36bb361 100644 --- a/tutorial/content/labs/instrumentation/manual/traces/index.md +++ b/tutorial/content/labs/instrumentation/manual/traces/index.md @@ -58,7 +58,7 @@ The output reveals that OpenTelemetry's API and SDK packages have already been i ### configure tracing pipeline and obtain a tracer -{{< figure src="images/tracer.drawio_pipeline.svg" width=600 caption="tracing signal" >}} +{{< figure src="images/create_tracer_configure_pipeline.drawio.png" width=650 caption="tracing signal" >}} ```py { title="trace_utils.py" } # OTel SDK @@ -125,7 +125,7 @@ Run `python app.py` to verify that there are no errors. ### generate trace data -{{< figure src="images/tracer.drawio_span.svg" width=600 caption="tracing signal" >}} +{{< figure src="images/tracer_generates_spans.drawio.png" width=650 caption="tracing signal" >}} ```py { title="app.py" } @app.route("/") @@ -174,7 +174,7 @@ This causes the tracer to generate a span object, for which the tracing pipeline A span in OpenTelemetry represents a single operation within a trace and carries a wealth of information that provides insight into the operation's execution. This includes the `name` of the span, which is a human-readable string that describes the operation. The trace context, consisting of the `trace_id`, `span_id`, and `trace_state`, uniquely identifies the span within the trace and carries system-specific configuration data. The `SpanKind` indicates the role of the span, such as whether it's an internal operation, a server-side operation, or a client-side operation. If the `parent_id` is `null`, it signifies that the span is the root of a new trace. The `start_time` and `end_time` timestamps mark the beginning and end of the span's duration. Additionally, spans can contain `attributes` that provide further context, such as HTTP methods or response status codes, and a `resource` field that describes the service and environment. Other fields like `events`, `links`, and `status` offer additional details about the span's lifecycle, outcome and context. ### enrich spans with context -{{< figure src="images/tracer.drawio_enrich_span_with_context.svg" width=600 caption="enriching spans with resources and attributes" >}} +{{< figure src="images/enrich_spans_with_context.drawio.png" width=650 caption="enriching spans with resources and attributes" >}} So far, the contents of the span were automatically generated by the SDK. This information is enough to reason about the chain of events in a transaction and allows us to measure latency. @@ -305,7 +305,7 @@ Flask creates a [request context](https://flask.palletsprojects.com/en/2.3.x/req ### context propagation -{{< figure src="images/trace_propagation.drawio.svg" width=600 caption="trace context propagation" >}} +{{< figure src="images/trace_propagation.drawio.png" width=650 caption="trace context propagation" >}} Until now, we only looked at the contents of a singular span. However, at its core, distributed tracing is about understanding the chain of operations that make up a transaction. @@ -423,7 +423,7 @@ Re-run our `httpbin` experiment. You should now see that the outgoing request contains a header called `traceparent`. If you have prior experience with distributed tracing, you might already know that different tracing systems use different formats (such as [b3 propagation](https://github.com/openzipkin/b3-propagation) used by Zipkin). -{{< figure src="images/doordash_traceparent_header.png" width=600 caption="placeholder" >}} +{{< figure src="images/doordash_traceparent_header.png" width=650 caption="format used by the traceparent header [Gud21](https://doordash.engineering/2021/06/17/leveraging-opentelemetry-for-custom-context-propagation/)" >}} By default, OpenTelemetry uses a [specification](https://www.w3.org/TR/trace-context/) established by the World Wide Web Consortium (W3C). Looking at the header's value, we can infer that it encodes the trace context as `---`.