Define the questions the log should answer

AI request logs help establish which application version was running, where processing stopped, and whether the result was accepted. Start with those questions. If a record helps answer none of them, explain separately why it needs to be stored. This review establishes the minimum diagnostic dataset.

The OpenTelemetry section on generative AI is marked Development: its conventions are still evolving. It recommends leaving instructions, input messages, and model outputs out of telemetry by default. Enabling their collection should be an explicit decision. This provides a useful starting point for your application's policy.

The practical outcome is an approved field list, a map of storage destinations, and a test record. Together, these should demonstrate two things: the relevant failure can be reconstructed from events, and conversation content has stayed out of routine diagnostics.

Agree on fields and connections between events

Assign a random identifier to each operation and a separate number to each attempt. Record the time, processing stage, application version, prompt template version, selected model, and final status. Numeric fields are sufficient for duration and output size; they do not need the response text.

Define status values in advance: completed, error, canceled, and outcome unknown. Specify which event supports each status. Record receiving an answer separately from applying it in the application. This makes it possible to detect a generation that completed but whose result was rejected during validation.

W3C Trace Context prohibits personal and other sensitive information in traceparent and tracestate. Use independent random values to connect events. An email address, a customer's filename, or message content is unsuitable as a diagnostic identifier.

Find every destination for diagnostic data

Map every diagnostic destination: the browser, application server, model client library, trace collector, error reporting system, notifications, and manual exports. For each, identify its owner, available fields, retention period, and deletion route. Inspect the actual settings of the specific environment.

OpenTelemetry's exception conventions explicitly warn that exception.message may contain sensitive information. Include error text in the inspection. In your own records, use a controlled failure category and processing stage. Review free-form descriptions before saving them when they are actually necessary.

Apply an approved field list at the entry point to the log. Inspection should cover nested objects, link addresses, and automatically attached information. If an error reporting system independently attaches the original request, filtering the main message line does not cover that additional channel.

Test with a fictional customer request

Illustrative example: a portable ramp rental application drafts a customer reply. The invented request and response contain different marker phrases: “amber customer contact” and “internal ramp note.” These are artificial content markers, rather than actual information about people.

Place the first phrase in the input message and the second in a prepared response and a nested error description. Simulate four outcomes: success, response rejection during validation, cancellation, and timeout. Prepared data is sufficient for this test, without a paid model call.

In the hypothetical log, all four operations receive start and outcome events. However, the timeout causes the second phrase to appear in the error reporting export. Even when the main table looks clean, this example reveals an unacceptable content storage route that needs to be closed.

Check content exclusion and event completeness

Wait for the event delivery window established for the test. Search for both phrases across every destination and available export, including nested fields. Send an approved control marker through the same route and confirm that every destination sees it. Otherwise, empty results could indicate an incorrect time range or failed delivery.

Check the log's usefulness: each of the four outcomes should have a discoverable start, relevant stages, and a status supported by evidence. In this example, acceptance requires four complete chains out of four and neither phrase in routine diagnostics. This is a local criterion, rather than a universal standard.

Repeat the inspection using an on-call employee's account and a role denied access to the log. Also check exports and notification links. Accept the fix after repeating all four scenarios. Deleting the discovered row alone does not remove the source that produced it.

Bound investigations and the conclusions you draw

If a particular investigation requires content, define a temporary collection mode: the specific operation, permitted fields, responsible person, authorized readers, and shutoff time. Establish the basis for that collection before enabling it. Set separate retention periods for diagnostic events and content, then verify deletion of accessible copies.

A log without conversations can establish the technical sequence but may not explain a model's semantic mistake. Artificial phrases test selected recording routes; they do not prove that all personal data will be detected. Event sampling, delays, and truncated fields also limit the conclusions.

Record library versions, collection settings, environment, and date in the test record. Repeat the test after adding a collector, changing error handling, or expanding recorded fields. Inspecting your own log describes data accessible to your application. Conclusions about a provider's internal storage require separate evidence.

Sources