Complete the code to start a new trace span in a microservice.
tracer = init_tracer('my-service') with tracer.start_span('[1]') as span: process_request()
The span name should describe the operation, such as 'handle_request'.
Complete the code to propagate trace context via HTTP headers.
headers = {}
tracer.inject(span.context, format=[1], carrier=headers)
send_request(headers)HTTP headers format is used to propagate trace context over HTTP.
Fix the error in the code to correctly extract trace context from incoming HTTP headers.
span_ctx = tracer.extract(format=[1], carrier=request.headers) with tracer.start_span('handle', child_of=span_ctx) as span: process()
Extracting trace context from HTTP headers requires the TEXT_MAP format.
Fill both blanks to create a trace span with tags for service name and error status.
with tracer.start_span('db_query') as span: span.set_tag('[1]', 'user-service') span.set_tag('[2]', True)
Use 'service.name' to tag the service and 'error' to indicate an error occurred.
Fill all three blanks to create a dictionary of spans with their durations filtered by duration > 100ms.
slow_spans = {span.[1]: span.[2] for span in spans if span.[3] > 100}Use 'operation_name' as key, 'duration_ms' as value, and filter by 'duration_ms' > 100.