AI logging in production: context without oversharing
Instrument AI workflows with useful metadata, configuration versions, and clear outcomes—not entire conversations.
Design AI logs for workflows, retrieval, tool actions, and application outcomes—with metadata at the center.
{
"schema_version": "1.0",
"timestamp": "2026-09-21T09:41:02.184Z",
"severity": "INFO",
"event_id": "evt_demo_002",
"event_name": "generation.completed",
"service": "assistant-worker",
"attributes": {
"workflow_id": "wf_demo_042",
"model": "example-model",
"config_version": "prompt-v3",
"outcome": "completed",
"duration_ms": 842
}
}Separate retrieval, generation, validation, and persistence.
Reference versioned settings without copying private documents.
Treat prompt and output capture as separate, restricted decisions.
A successful model response is not necessarily a successful application workflow. Record stage-specific outcomes and distinguish a proposed tool action from an executed one. Preserve the configuration references needed to investigate behavior after a release.
These fields illustrate a design pattern. Map them deliberately to your own schema, source, and destination.
| Field | What it means |
|---|---|
workflow_id | The logical application operation across attempts. |
model | A configured model or deployment reference. |
config_version | The prompt, retrieval, or application configuration revision. |
outcome | What this stage actually completed or failed to do. |
Do not place private conversations, tool credentials, or unrestricted document content in routine telemetry.
Technical reference: OpenTelemetry GenAI semantic conventions . Verify the version and settings used by your own implementation.
Instrument AI workflows with useful metadata, configuration versions, and clear outcomes—not entire conversations.
Trace retrieval, generation, validation, and retries without confusing model completion with application success.
Minimize fields, apply deliberate transformations, and test redaction through storage, viewers, and exports.
Start with a clear schema. Keep the context that matters.