Question 40
An SDK creates useful spans but leaves them open on exceptions and traces display incorrect nested durations. Which engineering change is the most direct response to the stated failure and constraint?
Explanation
Correct Answer
This remedy fits the observed case: An SDK creates useful spans but leaves them open on exceptions and traces display incorrect nested durations. Use supported context managers or finally blocks to end spans reliably. The underlying issue is Unfinished spans distort timing and prevent faithful trace export. Direct acceptance evidence is Injected exceptions close spans and show coherent start/end timing.
Incorrect Answers
The SDK records spans but no working exporter sends them to the collector. This is a separate requirement; the current case instead hinges on: Unfinished spans distort timing and prevent faithful trace export. The matching answer is: Use supported context managers or finally blocks to end spans reliably.
The alternative addresses: Baggage travels across trust boundaries and can expose sensitive data. The reported constraint here is different: Unfinished spans distort timing and prevent faithful trace export. The case-specific choice is: Use supported context managers or finally blocks to end spans reliably.
Exceptions are swallowed or not recorded by tracing instrumentation. By contrast, the relevant technical condition here is: Unfinished spans distort timing and prevent faithful trace export. The appropriate selection is: Use supported context managers or finally blocks to end spans reliably.