Review the prerequisites
Suitable for: Backend developers learning Agent applications.
- Task causality and resource attribution
- Observability is about connecting a user task to real models, tools, and business effects. The timeline is used to explain waiting, and the resource account is used to explain costs. The two cannot be replaced by model self-statement or simple accumulation.
How does the mechanism work?
Step-by-step explanation
- How does an asynchronous worker restore the trace context? What should I do if the context is missing?
After a task outlives its HTTP request, maintain traceable correlations.
- Why can't the time consumption of concurrent spans be added directly?
After breaking down the components, explain the difference between measured component durations and the user's wait time.
- If I/O logging is turned off, how can I retain the minimum evidence of a reproducible problem?
Evidence is required for troubleshooting, but the scope of recording is subject to data minimization.
Foundation · Understand the concepts
Understand the principle · What each event actually proves
Objectives of this level: Separate causal identity, latency, usage and business evidence using a concrete lost-response sequence.
Visual guide · Snapshots are not new events
The route snapshots share the same ledger events. Simulated resource units remain simulated after correcting the count; missing provider usage is unknown. Select the figure to open it at full size.
Measurement version: the capstone event counts, simulated usage and route outputs in this track refer to the original immutable
enterprise-after-sales-agent-v1.zipand its bundled README/records. Extract that original archive for those exact observations. The 1.0.1 evidence-contract archive changes prompt/tool data; do not reuse these numbers for it. The separate new SDK/OTLP exercise below records its own version and results.
Start with the recorded event sequence
For task main-return, the route records these facts. Event IDs below refer to one local ledger; they are not universal IDs:
- Event 20 is
action_request; its nestedpayload.payloadincludestask_id="main-return",operation_key="return:main-return:v1", proposal hash, approval ID and fence. - Event 21 is
action_unknown, with the same operation key andreason="merchant_transport_unknown". - Event 23 is
receipt_lookup,found=true, with a receipt containing the same task ID, operation key and proposal hash. - Event 24 is
business_receipt, with that receipt andreconciled=true. Independent merchant audit lists one application for this task.
The evidence points to a lost transport response followed by reconciliation, not a second application. A nearby timestamp alone cannot prove this relationship: the stable business key and receipt binding do. The merchant receipt establishes an application, not a refund or an assessment of the answer’s prose.
Four questions need different fields
- Which task and action? Use task ID, event ID within its ledger, tool call ID, operation key and bound proposal hash. A simulated response ID such as
simulated-response-1is reused across tasks and cannot be a global join key. - How long? Model metadata and tool payloads contain measured
latency_ms. An event timestamp is a point, not a span with parent/start/end. Do not calculate a distributed critical path from event order alone. - How much resource? Offline
metadata.usagehassource="simulated",input_unitsandoutput_units, based on Unicode character count divided by four. It is neither provider token usage nor billed money. A failed live request may haveusage=null; unknown is not zero. - Did the business succeed? Compare a bound receipt and per-task merchant audit. HTTP 200, a model response and tool_count alone cannot answer this.
Derive the counting boundary
The tool, fault and recovery records are cumulative snapshots of the same task. Each includes the original four model_response events. Concatenating them reports 12 responses even though there were four. Deduplicate ledger events, then sum usage once. Conversely, two real attempts with different event IDs must both count, even if they return the same error.
This project is a local event chain, not complete OpenTelemetry spans, queue instrumentation or a production P95 baseline. For future instrumentation, OpenTelemetry traces describe span relationships and timing; the current JSON does not supply those missing fields.
code example
Approval waiting has its own definition
A long end-to-end wait can be caused by the review queue even when measured model calls are fast. Future instrumentation needs explicit wait-start and resume events, active-compute intervals and an end-to-end definition. This route does not currently provide a production approval-wait metric.
Acceptance task for this level
For events 20/21/23/24, write one supported conclusion and one unsupported inference each. Explain why three cumulative snapshots show 12 raw model_response rows but only four actual response events.
Reading this browser’s record…
Hide the answer and check your understanding
An action_unknown event occurs before a successful receipt_lookup. Does that mean two business writes happened?
Expand reference derivation
No. action_unknown means the caller lacks a definitive response to its write. A lookup returning the same bound operation key establishes an existing receipt. The independent per-task audit determines the number of committed applications; the number of local transport events is not the number of effects.
Further explanations and practice
When encountering unfamiliar principles, first read the implementation, continuous questioning and migration cases, and then independently explain the premise and boundaries. Answers and notes are saved to the original account record.
All linked explanations and exercises (1 )
Sources and verification scope
The principles are based on public information; the numbers, cases and tasks are the teaching design of this website. Offline experiments verify the range noted on this page, and the learning effect still needs to be judged through independent tasks and feedback.