MCPA Certification Curriculum

One Trace ID Ties Auditability to Observability

A trace id is the one value that follows a single call through a client, a server, and whatever that server calls next, and a hash chain is what lets you prove, months later, that the record of what happened has not been quietly edited. Propagate OpenTelemetry trace context, the traceparent, tracestate, and baggage keys, through meta in the W3C formats SEP-414 defines, across a client, a server, and the upstream call that server makes on a caller's behalf. Generate and validate a W3C traceparent value's four segments (version, trace id, parent id, flags) in lowercase hex, and derive a child span that keeps the trace id while minting a fresh parent id at every hop. Explain why logging is deprecated in favor of stderr on stdio or OpenTelemetry for structured observability, and what a per-request log level still does despite that deprecation. Build an audit record that names an authenticated principal instead of self-reported clientInfo, redacts a flagged argument before an entry ever exists, and correlates activity by request id and trace id. Verify a hash-chained audit log, explain exactly where tampering surfaces and why, and treat a log without that property as a claim rather than as evidence. An account's API key gets rotated. The call that rotated it actually touched two programs: the service desk tool a…

One Trace ID Ties Auditability to Observability: A trace id is the one value that follows a single call through a client, a server, and whatever that server…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.