Complete the code to define the unique identifier used to track a request across services.
trace_id = generate_[1]() # Unique ID for distributed tracing
The trace_id uniquely identifies a request as it travels through multiple services.
Complete the code to create a new span representing a unit of work in distributed tracing.
span = tracer.start_[1](name="database_query")
A span represents a single operation or unit of work within a trace.
Fix the error in the code to correctly propagate trace context between services.
headers["[1]"] = serialize_trace_context(trace_context)
The traceparent header is the standard way to propagate trace context across service boundaries.
Fill both blanks to correctly extract and start a child span from incoming trace context.
incoming_context = extract_trace_context([1]) child_span = tracer.start_span(name="process_request", context=[2])
The trace context is extracted from the incoming request headers, then used to start a child span.
Fill all three blanks to build a dictionary representing a trace span with its ID, parent ID, and operation name.
span_info = {
"span_id": [1],
"parent_id": [2],
"operation": "[3]"
}The span_id is the current span's ID, parent_id is the parent's ID, and operation is the name of the work done.