Distinguish logs, metrics and traces
Logs record events such as a parsing error. Metrics summarize counts, durations or failure rates. Traces connect stages of one operation. An average-latency chart cannot explain why one answer used the wrong source.
Assign a run identifier and separate identifiers for sources, facts, pages and releases. Identical question text does not identify the same execution; an unchanged URL does not identify unchanged content. Preserve hashes, question versions and environment context.
Define an event contract
| Field | Purpose | Prevented confusion |
|---|---|---|
| run_id | Connect one task | Another task's success credited here |
| stage | Fetch, validate, publish, verify | Upload mistaken for acceptance |
| artifact_version | Identify inputs or outputs | New files explain old results |
| parent_id | Link branches and retries | Lost lineage |
| status and error_type | Pass, fail or unknown | Missing data hides errors |
| duration and time | Cost and sequence | Download time becomes inference speed |
The executable fixture uses only run_id, stage and artifact_version. The remaining fields are production recommendations, not claims of implemented distributed tracing.
Detect a missing stage locally
demo-001 contains fetch, validate, publish and verify events. trace_gaps returns no omissions for the complete list and identifies verify after that event is removed. Events from another run cannot fill the gap.
The helper checks presence only. It does not validate side effects, ordering, error states or artifact hashes. A fabricated verification event could therefore pass this minimal check. Production acceptance must bind events to actual responses, hashes and outcomes.
Let error classes determine handling
Separate network timeout, parsing failure, fact conflict, permission denial, publication failure and unknown evaluation status. Network issues may permit retry; fact conflicts need review; permission denial must not trigger automatic privilege escalation.
End-to-end duration may include waiting and human review, while inference comparisons should separate network, loading and computation. First-time downloads and cache preparation materially affect runtime. Declare the environment rather than selecting the fastest attempt.
Preserve lineage without exposing client data
Logs can retain fact identifiers and controlled references rather than whole submissions. Exclude contact details, credentials, cookies and unauthorized text before logging. A pseudonymous task number does not make every associated field safe to publish.
Answer records should resolve to source URLs and supporting passages. Releases should resolve to approved versions and live checks. If a source disappears later, retain the acquisition time and lawful evidence record instead of replacing it silently with a similar page.
Zhihe Growth's inspectable delivery model
A client should be able to move from a report to question-level observations, then to evidence and content changes. Separate organized data, live pages, discovered URLs, observed citations and qualified inquiries.
The executed material is a small event-completeness check, not an installed OpenTelemetry collector or distributed tracing service. Production integration needs retention, access controls, sampling, alert thresholds and ownership. Reliable identifiers and evidence come before attribution dashboards.
Trace exercise: move from symptom to evidence
| Symptom | Identifiers | Evidence | Avoid |
|---|---|---|---|
| Wrong model | Query, source, fact version | Prompt and fields | Blame embeddings immediately |
| Stale English | Page and source version | Translation lineage | Browser refresh alone |
| Download 404 | Release and asset hash | Manifest and response | Uploaded means accepted |
| Duplicate action | Request and event IDs | Retry history | Delete duplicate logs |
| Lower citation rate | Questions and platform state | Answers and sources | Blame one new article |
| More inquiries | Business record and window | Channel and qualification | Attribute all to AI |
Confirm records belong to the same run. Different clocks and time zones can distort ordering; a dated filename does not establish lineage. Audit both directions between a release receipt, public file hash and source version. Missing links are traceability gaps, not proof of either success or nonexecution.
Materials and reference
Download the event-chain example. The OpenTelemetry overview provides general telemetry context. Read the state machine, dataset governance and inquiry attribution. Logs alone do not establish causal impact.