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.
Design · Explain the trade-offs
Design tradeoffs · Distributed timing, sampling and privacy
Objectives of this level: Specify a future observability contract under changed traffic/privacy constraints without treating current event JSON as complete telemetry.
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.
Changed operating conditions
Design a future deployment with an API, a queue, three concurrent retrieval branches and a human reviewer. Exercise constraints are: 1,000 tasks per minute, 95% end-to-end completion within five minutes excluding explicitly reported approval waiting, 1% successful-task diagnostic sampling, all denied or outcome_unknown cases retained, and no raw customer question or tool reason in ordinary telemetry. These are design inputs; this course supplies no production measurements or instrumentation implementing them.
Derive the required changes
- Define task start/end and approval-wait start/resume. Also retain wall-clock end-to-end latency including review so the user wait is visible. Queue waiting and active work need separate observations; removing the approval interval must not hide queue delays.
- Propagate trace context across the queue and link or parent asynchronous work according to its real relationship. Keep a stable business task/action identity separately. Missing context starts a marked gap; it cannot be reconstructed by guessing from adjacent timestamps or used as authenticated identity.
- Record actual span start/end and parent/link relationships before claiming a critical path. The current ordered events and latency_ms values are not sufficient. Concurrent retrieval work can overlap, and nested durations must not be summed twice. Local event timestamps depend on the host clock and do not establish cross-host ordering or a production P95 baseline.
- Low-cardinality metrics can use stage, result and deployed version. Task/order IDs belong in controlled diagnostic correlation, not metric labels. A 1% diagnostic sample cannot by itself be the denominator for full-traffic completion or P95; aggregate the population separately and define the percentile/window before evaluating the objective.
- Keep redacted ordinary telemetry and a separately authorized, expiring incident payload store. A digest helps detect changed content but cannot reproduce its text. Preserve approval/write audit evidence durably under its own policy; sampling ordinary successes must not drop the only record of a business effect.
- Record provider usage and versioned price estimates separately from invoices. Missing usage is unresolved, retries consume resources, and provider discounts/account allocations can prevent request estimates from equalling the bill.
Deliver the schema/mapping and sampling/privacy policy as a design proposal. The current project has no OpenTelemetry exporter, full span hierarchy, queue trace propagation, production metrics backend or enforced redacted telemetry pipeline. Read context propagation for the intended mechanism; do not say that adding run_id alone implements it.
New executable integration boundary · 2026-10-30
Continue with Harness production integration. Its separate localhost exercise uses the actual OpenTelemetry SDK and OTLP exporter, propagates HTTP trace context, links a resumed worker and checks that a rejected export does not erase the independent business receipt. These are local collector/fixture results; the after-sales capstone still has no production metrics backend, distributed sampling or retention pipeline. Do not label that reference exercise a deployment of this project.
code example
A release comparison needs fixed inputs
If tokens rise while top-k, prompt and model all change, an event report identifies the affected stages but cannot isolate which change caused the increase. Compare fixed cases with controlled versions and record usage source; then use business and evidence checks to ensure a faster variant did not lose required policy context.
Acceptance task for this level
Design field mappings and a retention/sampling policy for the distributed five-minute objective. Show one parallel timeline, one missing-context case and one unsampled-success accounting case; list the runtime/instrumentation work still required.
Reading this browser’s record…
Hide the answer and check your understanding
If only 1% of successful traces are retained, can their P95 certify the five-minute full-traffic objective?
Expand reference derivation
Not by itself. Define the eligible population and time boundaries and measure full-traffic latency/completion with unsampled aggregate instrumentation. A biased diagnostic sample can explain incidents but does not automatically represent the full distribution. Current local route times cannot certify that production objective either.
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.